Skip to content

Commit e0eeecb

Browse files
authored
fix(tests): EOF - Align EOFCREATE args with EXT*CALL (#1274)
1 parent cc023a4 commit e0eeecb

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

src/ethereum_test_vm/opcode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5092,12 +5092,12 @@ class Opcodes(Opcode, Enum):
50925092
popped_stack_items=4,
50935093
pushed_stack_items=1,
50945094
data_portion_length=1,
5095-
kwargs=["value", "salt", "input_offset", "input_size"],
5095+
kwargs=["salt", "input_offset", "input_size", "value"],
50965096
)
50975097
"""
50985098
!!! Note: This opcode is under development
50995099
5100-
EOFCREATE[initcontainer_index] (value, salt, input_offset, input_size)
5100+
EOFCREATE[initcontainer_index] (salt, input_offset, input_size, value)
51015101
----
51025102
51035103
Description

tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_eofcreate.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def test_calldata(state_test: StateTestFiller, pre: Alloc):
275275
sections=[
276276
Section.Code(
277277
code=Op.MSTORE(0, Op.PUSH32(calldata))
278-
+ Op.SSTORE(slot_create_address, Op.EOFCREATE[0](0, 0, 0, calldata_size))
278+
+ Op.SSTORE(slot_create_address, Op.EOFCREATE[0](input_size=calldata_size))
279279
+ Op.STOP,
280280
),
281281
Section.Container(container=initcode_subcontainer),
@@ -497,7 +497,7 @@ def test_address_collision(
497497
Section.Code(
498498
code=Op.SSTORE(slot_create_address, Op.EOFCREATE[0](0, 0, 0, 0))
499499
+ Op.SSTORE(slot_create_address_2, Op.EOFCREATE[0](0, 0, 0, 0))
500-
+ Op.SSTORE(slot_create_address_3, Op.EOFCREATE[0](0, 1, 0, 0))
500+
+ Op.SSTORE(slot_create_address_3, Op.EOFCREATE[0](salt=1))
501501
+ Op.SSTORE(slot_code_worked, value_code_worked)
502502
+ Op.STOP,
503503
),
@@ -556,7 +556,9 @@ def test_eofcreate_revert_eof_returndata(
556556
sections=[
557557
Section.Code(
558558
code=Op.CALLDATACOPY(0, 0, Op.CALLDATASIZE)
559-
+ Op.SSTORE(slot_create_address, Op.EOFCREATE[0](0, salt, 0, Op.CALLDATASIZE))
559+
+ Op.SSTORE(
560+
slot_create_address, Op.EOFCREATE[0](salt=salt, input_size=Op.CALLDATASIZE)
561+
)
560562
+ Op.SSTORE(slot_returndata_size, Op.RETURNDATASIZE)
561563
+ Op.STOP,
562564
),
@@ -688,7 +690,7 @@ def test_eofcreate_context(
688690
sections=[
689691
Section.Code(
690692
Op.SSTORE(slot_code_worked, value_code_worked)
691-
+ Op.EOFCREATE[0](eofcreate_value, 0, 0, 0)
693+
+ Op.EOFCREATE[0](value=eofcreate_value)
692694
+ Op.STOP
693695
),
694696
Section.Container(initcode),

tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_eofcreate_failures.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def test_auxdata_size_failures(state_test: StateTestFiller, pre: Alloc, auxdata_
291291
sections=[
292292
Section.Code(
293293
code=Op.CALLDATACOPY(0, 0, Op.CALLDATASIZE)
294-
+ Op.SSTORE(slot_create_address, Op.EOFCREATE[0](0, 0, 0, Op.CALLDATASIZE))
294+
+ Op.SSTORE(slot_create_address, Op.EOFCREATE[0](input_size=Op.CALLDATASIZE))
295295
+ Op.SSTORE(slot_code_worked, value_code_worked)
296296
+ Op.STOP,
297297
),
@@ -347,7 +347,7 @@ def test_eofcreate_insufficient_stipend(
347347
initcode_container = Container(
348348
sections=[
349349
Section.Code(
350-
code=Op.SSTORE(slot_create_address, Op.EOFCREATE[0](value, 0, 0, 0))
350+
code=Op.SSTORE(slot_create_address, Op.EOFCREATE[0](value=value))
351351
+ Op.SSTORE(slot_code_worked, value_code_worked)
352352
+ Op.STOP,
353353
),
@@ -451,7 +451,7 @@ def test_insufficient_gas_memory_expansion(
451451
initcode_container = Container(
452452
sections=[
453453
Section.Code(
454-
code=Op.SSTORE(slot_create_address, Op.EOFCREATE[0](0, 0, 0, auxdata_size))
454+
code=Op.SSTORE(slot_create_address, Op.EOFCREATE[0](input_size=auxdata_size))
455455
+ Op.SSTORE(slot_code_should_fail, slot_code_worked)
456456
+ Op.STOP,
457457
),

tests/osaka/eip7692_eof_v1/eip7620_eof_create/test_gas.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ def test_eofcreate_gas(
140140
state_test,
141141
Environment(),
142142
pre,
143-
setup_code=Op.PUSH1(mem_expansion_bytes)
143+
setup_code=Op.PUSH32(value)
144+
+ Op.PUSH1(mem_expansion_bytes)
144145
+ Op.PUSH0
145-
+ code_increment_counter
146-
+ Op.PUSH32(value),
146+
+ code_increment_counter,
147147
subject_code=Op.EOFCREATE[0],
148148
tear_down_code=Op.STOP,
149149
cold_gas=EOFCREATE_GAS

0 commit comments

Comments
 (0)