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@008e492e.

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
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
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.

Test ID (Abbreviated)
...fork_Osaka-eof_test