Skip to content

Commit 2d2780e

Browse files
committed
review comments
1 parent 3b16499 commit 2d2780e

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

Diff for: tests/osaka/eip7692_eof_v1/eip7069_extcall/test_calls.py

-2
Original file line numberDiff line numberDiff line change
@@ -1177,8 +1177,6 @@ def test_extdelegate_call_targets(
11771177
to=factory_address,
11781178
data=caller_contract,
11791179
gas_limit=4_000_000,
1180-
max_priority_fee_per_gas=10,
1181-
max_fee_per_gas=10,
11821180
initcodes=[caller_contract],
11831181
)
11841182
calling_contract_address = compute_eofcreate_address(factory_address, 0)

Diff for: tests/osaka/eip7692_eof_v1/eip7873_tx_create/test_creation_tx.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
pytestmark = pytest.mark.valid_from(EOF_FORK_NAME)
2525

2626

27-
def test_legacy_creation_tx_legacy_initcode(
27+
@pytest.mark.with_all_contract_creating_tx_types(selector=lambda tx_type: tx_type != 6)
28+
def test_legacy_create_tx_legacy_initcode_eof_bytecode(
2829
state_test: StateTestFiller,
2930
pre: Alloc,
31+
tx_type: int,
3032
):
3133
"""Test that a legacy contract creation tx cannot create EOF code."""
3234
env = Environment()
@@ -35,6 +37,7 @@ def test_legacy_creation_tx_legacy_initcode(
3537
initcode = LegacyInitcode(deploy_code=smallest_runtime_subcontainer)
3638

3739
tx = Transaction(
40+
ty=tx_type,
3841
sender=sender,
3942
to=None,
4043
gas_limit=100000,
@@ -55,19 +58,22 @@ def test_legacy_creation_tx_legacy_initcode(
5558
)
5659

5760

61+
@pytest.mark.with_all_contract_creating_tx_types(selector=lambda tx_type: tx_type != 6)
5862
@pytest.mark.exception_test
59-
def test_legacy_creation_tx_eof_initcode(
63+
def test_legacy_create_tx_eof_initcode(
6064
state_test: StateTestFiller,
6165
pre: Alloc,
66+
tx_type: int,
6267
):
6368
"""Test that a legacy contract creation tx cannot use EOF initcode."""
6469
env = Environment()
6570
sender = pre.fund_eoa()
6671

6772
tx = Transaction(
73+
ty=tx_type,
6874
sender=sender,
6975
to=None,
70-
gas_limit=100000,
76+
gas_limit=100_000,
7177
data=smallest_initcode_subcontainer,
7278
error=TransactionException.EOF_CREATION_TRANSACTION,
7379
)

Diff for: tests/osaka/eip7692_eof_v1/eip7873_tx_create/test_txcreate.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,7 @@ def test_short_data_subcontainer(
731731
}
732732
tx = Transaction(
733733
to=contract_address,
734-
gas_limit=10_000_000,
735-
max_priority_fee_per_gas=10,
736-
max_fee_per_gas=10,
734+
gas_limit=100_000,
737735
sender=sender,
738736
initcodes=[initcontainer],
739737
)

Diff for: tests/osaka/eip7692_eof_v1/eip7873_tx_create/test_txcreate_failures.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ def test_invalid_container_deployment(
828828
Section.Container(deployed_container),
829829
],
830830
)
831-
tx_gas_limit = 10_000_000
831+
tx_gas_limit = 100_000
832832
fork_intrinsic_gas_calculator = fork.transaction_intrinsic_cost_calculator()
833833
fork_gas_costs = fork.gas_costs()
834834

@@ -860,14 +860,16 @@ def test_invalid_container_deployment(
860860
or reason == "out_of_gas_during_initcode"
861861
):
862862
invalid_code_path: Bytecode
863-
if reason == "invalid_opcode_during_initcode":
863+
if reason == "invalid_opcode_with_sstore_during_initcode":
864864
invalid_code_path = Op.SSTORE(0, 1) + Op.INVALID
865865
elif reason == "revert_opcode_during_initcode":
866866
invalid_code_path = Op.REVERT(0, 0)
867867
elif reason == "out_of_gas_during_initcode":
868868
invalid_code_path = Op.MSTORE(0xFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1)
869-
else:
869+
elif reason == "invalid_opcode_during_initcode":
870870
invalid_code_path = Op.INVALID
871+
else:
872+
raise Exception(f"invalid case: {reason}")
871873
initcontainer = Container(
872874
sections=[
873875
Section.Code(
@@ -931,8 +933,6 @@ def test_invalid_container_deployment(
931933
to=contract_address,
932934
sender=sender,
933935
gas_limit=tx_gas_limit,
934-
max_priority_fee_per_gas=10,
935-
max_fee_per_gas=10,
936936
initcodes=[initcontainer],
937937
)
938938

0 commit comments

Comments
 (0)