diff --git a/tests/prague/eip3540_eof_v1/test_eof_example.py b/tests/prague/eip3540_eof_v1/test_eof_example.py index f2271bc9b0a..a7caae85b00 100644 --- a/tests/prague/eip3540_eof_v1/test_eof_example.py +++ b/tests/prague/eip3540_eof_v1/test_eof_example.py @@ -6,7 +6,7 @@ from ethereum_test_tools import EOFTestFiller from ethereum_test_tools import Opcodes as Op -from ethereum_test_tools.eof.v1 import AutoSection, Container, Section +from ethereum_test_tools.eof.v1 import AutoSection, BytesConvertible, Container, Section from ethereum_test_tools.eof.v1.constants import NON_RETURNING_SECTION from .spec import EOF_FORK_NAME @@ -63,8 +63,8 @@ def test_eof_example(eof_test: EOFTestFiller): # This will construct a valid EOF container with these bytes assert bytes(eof_code) == bytes.fromhex( - "ef0001010010020004000500060008000204000000008000010100000100010003020300035fe300010050" - "e3000250e43080e300035050e480e4" + "ef0001010010020004000500060008000204000100008000010100000100010003020300035fe300010050" + "e3000250e43080e300035050e480e4ef" ) eof_test( @@ -125,3 +125,38 @@ def test_eof_example_custom_fields(eof_test: EOFTestFiller): data=eof_code, expect_exception=eof_code.validity_error, ) + + +@pytest.mark.parametrize( + "data_section_bytes", + ("0x01", "0xef"), +) +@pytest.mark.parametrize( + "code_section_code", + (Op.PUSH1(10) + Op.STOP, Op.PUSH1(14) + Op.STOP), +) +def test_eof_example_parameters( + eof_test: EOFTestFiller, + data_section_bytes: BytesConvertible, + code_section_code: BytesConvertible, +): + """ + Example of python EOF classes + """ + eof_code = Container( + name="parametrized_eof_example", + sections=[ + Section.Code( + code=code_section_code, + code_inputs=0, + code_outputs=NON_RETURNING_SECTION, + max_stack_height=1, + ), + Section.Data(data_section_bytes), + ], + ) + + eof_test( + data=eof_code, + expect_exception=eof_code.validity_error, + )