Skip to content

Commit b48db3c

Browse files
authored
new(tests): EOF - EIP-7620: Dangling data in subcontainer test (#812)
* Dangling data in subcontainer test Test dangling data inside a subcontainer Signed-off-by: Danno Ferrin <[email protected]> * style fix Signed-off-by: Danno Ferrin <[email protected]> * remove duplicate test Signed-off-by: Danno Ferrin <[email protected]> * sections sizes should match Signed-off-by: Danno Ferrin <[email protected]> --------- Signed-off-by: Danno Ferrin <[email protected]>
1 parent be613a0 commit b48db3c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/prague/eip7692_eof_v1/eip7620_eof_create/test_subcontainer_validation.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,3 +789,42 @@ def test_migrated_eofcreate(eof_test: EOFTestFiller, container: Container):
789789
Tests migrated from EOFTests/efValidation/EOF1_eofcreate_valid_.json.
790790
"""
791791
eof_test(data=container, expect_exception=container.validity_error)
792+
793+
794+
def test_dangling_initcode_subcontainer_bytes(
795+
eof_test: EOFTestFiller,
796+
):
797+
"""Initcode mode EOF Subcontainer test with subcontainer containing dangling bytes."""
798+
eof_test(
799+
data=Container(
800+
sections=[
801+
returncontract_code_section,
802+
Section.Container(
803+
container=Container(
804+
raw_bytes=stop_sub_container.data + b"\x99",
805+
),
806+
),
807+
],
808+
kind=ContainerKind.INITCODE,
809+
),
810+
expect_exception=EOFException.INVALID_SECTION_BODIES_SIZE,
811+
)
812+
813+
814+
def test_dangling_runtime_subcontainer_bytes(
815+
eof_test: EOFTestFiller,
816+
):
817+
"""Runtime mode EOF Subcontainer test with subcontainer containing dangling bytes."""
818+
eof_test(
819+
data=Container(
820+
sections=[
821+
eofcreate_code_section,
822+
Section.Container(
823+
container=Container(
824+
raw_bytes=returncontract_sub_container.data + b"\x99",
825+
),
826+
),
827+
],
828+
),
829+
expect_exception=EOFException.INVALID_SECTION_BODIES_SIZE,
830+
)

0 commit comments

Comments
 (0)