Skip to content

test_returning_section_returncontract()

Documentation for tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_nonreturning_validation.py::test_returning_section_returncontract@008e492e.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_nonreturning_validation.py::test_returning_section_returncontract --fork Osaka

Test EOF validation failing because a returning section has no RETF or JUMPF-to-returning - RETURNCONTRACT version.

Source code in tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_nonreturning_validation.py
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@pytest.mark.parametrize(
    "code_section",
    [
        pytest.param(
            Section.Code(Op.RETURNCONTRACT[0](0, 0), code_outputs=0), id="returncontract0"
        ),
        pytest.param(
            Section.Code(Op.PUSH0 + Op.RETURNCONTRACT[0](0, 0), code_outputs=1),
            id="returncontract1",
        ),
    ],
)
def test_returning_section_returncontract(eof_test: EOFTestFiller, code_section: Section):
    """
    Test EOF validation failing because a returning section has no RETF or JUMPF-to-returning -
    RETURNCONTRACT version.
    """
    eof_test(
        container=Container(
            sections=[
                Section.Code(Op.CALLF[1] + Op.INVALID, max_stack_height=code_section.code_outputs),
                code_section,
            ]
            + [Section.Container(Container.Code(Op.INVALID))],
            validity_error=EOFException.INVALID_NON_RETURNING_FLAG,
            kind=ContainerKind.INITCODE,
        )
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) code_section
...fork_Osaka-eof_test-returncontract0 data=b'`\x00`\x00\xee\x00' custom_size=0 kind= force_type_listing=False code_inputs=0 code_outputs=0 max_stack_height=2 auto_max_stack_height=False auto_code_inputs_outputs=False skip_header_listing=False skip_body_listing=False skip_types_body_listing=False skip_types_header_listing=False
...fork_Osaka-eof_test-returncontract1 data=b'_`\x00`\x00\xee\x00' custom_size=0 kind= force_type_listing=False code_inputs=0 code_outputs=1 max_stack_height=3 auto_max_stack_height=False auto_code_inputs_outputs=False skip_header_listing=False skip_body_listing=False skip_types_body_listing=False skip_types_header_listing=False