Skip to content

Commit be613a0

Browse files
new(tests): EOF - EIP-7620: EOFCREATE referencing the same subcontainer twice (#809)
* tests/prague/eof/eof_create: added test EOFCreate referencing the same subcontainer twice * add returncontract case Signed-off-by: Danno Ferrin <[email protected]> * fix comments and further specialize Signed-off-by: Danno Ferrin <[email protected]> --------- Signed-off-by: Danno Ferrin <[email protected]> Co-authored-by: Danno Ferrin <[email protected]>
1 parent 758baf3 commit be613a0

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/prague/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,39 @@ def test_container_both_kinds_different_sub(eof_test: EOFTestFiller):
464464
)
465465

466466

467+
def test_container_multiple_eofcreate_references(eof_test: EOFTestFiller):
468+
"""Test multiple references to the same subcontainer from an EOFCREATE operation"""
469+
eof_test(
470+
data=Container(
471+
sections=[
472+
Section.Code(
473+
code=Op.EOFCREATE[0](0, 0, 0, 0) + Op.EOFCREATE[0](0, 0, 0, 0) + Op.STOP,
474+
),
475+
returncontract_sub_container,
476+
],
477+
),
478+
)
479+
480+
481+
def test_container_multiple_returncontract_references(eof_test: EOFTestFiller):
482+
"""Test multiple references to the same subcontainer from a RETURNCONTACT operation"""
483+
eof_test(
484+
data=Container(
485+
sections=[
486+
Section.Code(
487+
code=Op.PUSH0
488+
+ Op.CALLDATALOAD
489+
+ Op.RJUMPI[6]
490+
+ Op.RETURNCONTRACT[0](0, 0)
491+
+ Op.RETURNCONTRACT[0](0, 0)
492+
),
493+
stop_sub_container,
494+
],
495+
kind=ContainerKind.INITCODE,
496+
),
497+
)
498+
499+
467500
@pytest.mark.parametrize("version", [0, 255], ids=lambda x: x)
468501
def test_subcontainer_wrong_eof_version(
469502
eof_test: EOFTestFiller,

0 commit comments

Comments
 (0)