Skip to content

test_retf_in_nonreturning()

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

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
148
149
150
151
152
153
154
155
156
157
158
159
@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
...fork_Osaka-state_test_from_eof_test-code_prefix_-first_True True
...fork_Osaka-state_test_from_eof_test-code_prefix_-first_False False
...fork_Osaka-state_test_from_eof_test-code_prefix_PUSH0-first_True PUSH0 True
...fork_Osaka-state_test_from_eof_test-code_prefix_PUSH0-first_False PUSH0 False
...fork_Osaka-state_test_from_eof_test-PUSH0x0x80-first_True True
...fork_Osaka-state_test_from_eof_test-PUSH0x0x80-first_False False
...fork_Osaka-blockchain_test_from_eof_test-code_prefix_-first_True True
...fork_Osaka-blockchain_test_from_eof_test-code_prefix_-first_False False
...fork_Osaka-blockchain_test_from_eof_test-code_prefix_PUSH0-first_True PUSH0 True
...fork_Osaka-blockchain_test_from_eof_test-code_prefix_PUSH0-first_False PUSH0 False
...fork_Osaka-blockchain_test_from_eof_test-PUSH0x0x80-first_True True
...fork_Osaka-blockchain_test_from_eof_test-PUSH0x0x80-first_False False