Skip to content

test_jumpf_in_nonreturning()

Documentation for tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_nonreturning_validation.py::test_jumpf_in_nonreturning@21fb11c8.

Generate fixtures for these test cases for Osaka with:

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

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

Source code in tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_nonreturning_validation.py
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
@first
@code_prefix
def test_jumpf_in_nonreturning(eof_test: EOFTestFiller, first: bool, code_prefix: Bytecode):
    """Test EOF validation failing due to non-returning section with the JUMPF instruction."""
    invalid_section = Section.Code(
        code_prefix + Op.JUMPF[1 if first else 2],
        code_outputs=NON_RETURNING_SECTION,
    )
    target_section = Section.Code(Op.RETF, code_outputs=0)
    sections = [invalid_section, target_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