Skip to content

test_retf_in_nonreturning()

Documentation for tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_nonreturning_validation.py::test_retf_in_nonreturning@49a16fac.

Generate fixtures for these test cases for Osaka with:

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

Test EOF validation failing due to non-returning section with the RETF instruction.

Source code in tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_nonreturning_validation.py
110
111
112
113
114
115
116
117
118
119
120
121
@first
@code_prefix
def test_retf_in_nonreturning(eof_test: EOFTestFiller, first: bool, code_prefix: Bytecode):
    """Test EOF validation failing due to non-returning section with the RETF instruction."""
    sections = [Section.Code(code_prefix + Op.RETF, code_outputs=NON_RETURNING_SECTION)]
    if not first:  # Prefix sections with additional valid JUMPF to invalid section
        sections = [Section.Code(Op.JUMPF[1])] + sections
    eof_test(
        container=Container(
            sections=sections, validity_error=EOFException.INVALID_NON_RETURNING_FLAG
        )
    )

Parametrized Test Cases

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

Test ID (Abbreviated) code_prefix first
...fork_Osaka-eof_test-code_prefix_-first_True True
...fork_Osaka-eof_test-code_prefix_-first_False False
...fork_Osaka-eof_test-code_prefix_PUSH0-first_True PUSH0 True
...fork_Osaka-eof_test-code_prefix_PUSH0-first_False PUSH0 False
...fork_Osaka-eof_test-PUSH0x0x80-first_True True
...fork_Osaka-eof_test-PUSH0x0x80-first_False False