Skip to content

test_rjumpi_at_the_end()

Documentation for tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py::test_rjumpi_at_the_end@14a7429a.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py::test_rjumpi_at_the_end --fork Osaka

Test invalid RJUMPI as the end of a code section. https://github.com/ipsilon/eof/blob/main/spec/eof.md#stack-validation 4.i: This implies that the last instruction must be a terminating instruction or RJUMP.

Source code in tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
def test_rjumpi_at_the_end(
    eof_test: EOFTestFiller,
):
    """
    Test invalid RJUMPI as the end of a code section.
    https://github.com/ipsilon/eof/blob/main/spec/eof.md#stack-validation 4.i:
    This implies that the last instruction must be a terminating instruction or RJUMP.
    """
    eof_test(
        container=Container(
            sections=[
                Section.Code(
                    code=Op.PUSH0 + Op.PUSH0 + Op.RJUMPI[1] + Op.STOP + Op.RJUMPI[-4],
                )
            ],
        ),
        expect_exception=EOFException.MISSING_STOP_OPCODE,
    )

Parametrized Test Cases

This test case is only parametrized by fork and fixture format.

Test ID (Abbreviated)
...fork_Osaka-eof_test
...fork_Osaka-state_test_from_eof_test
...fork_Osaka-blockchain_test_from_eof_test