Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new(tests): EOF - EIP-7620: EOFCREATE referencing the same subcontainer twice #809

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,39 @@ def test_container_both_kinds_different_sub(eof_test: EOFTestFiller):
)


def test_container_multiple_eofcreate_references(eof_test: EOFTestFiller):
"""Test multiple references to the same subcontainer from an EOFCREATE operation"""
eof_test(
data=Container(
sections=[
Section.Code(
code=Op.EOFCREATE[0](0, 0, 0, 0) + Op.EOFCREATE[0](0, 0, 0, 0) + Op.STOP,
),
returncontract_sub_container,
],
),
)


def test_container_multiple_returncontract_references(eof_test: EOFTestFiller):
"""Test multiple references to the same subcontainer from a RETURNCONTACT operation"""
eof_test(
data=Container(
sections=[
Section.Code(
code=Op.PUSH0
+ Op.CALLDATALOAD
+ Op.RJUMPI[6]
+ Op.RETURNCONTRACT[0](0, 0)
+ Op.RETURNCONTRACT[0](0, 0)
),
stop_sub_container,
],
kind=ContainerKind.INITCODE,
),
)


@pytest.mark.parametrize("version", [0, 255], ids=lambda x: x)
def test_subcontainer_wrong_eof_version(
eof_test: EOFTestFiller,
Expand Down