Skip to content

test_rjump_negative()

Documentation for tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_negative@21fb11c8.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_negative --fork Osaka

Test for a forward RJUMPI and backward RJUMP.

Source code in tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def test_rjump_negative(
    eof_state_test: EOFStateTestFiller,
):
    """Test for a forward RJUMPI and backward RJUMP."""
    eof_state_test(
        container=Container.Code(
            Op.PUSH1[1]
            + Op.RJUMPI[7]  # RJUMP cannot be used because of the backward jump restriction
            + Op.SSTORE(slot_code_worked, Op.MLOAD(0))
            + Op.STOP
            + Op.MSTORE(0, value_code_worked)
            + Op.RJUMP[-16]
        ),
        container_post=Account(storage={slot_code_worked: value_code_worked}),
    )

Parametrized Test Cases

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

Test ID (Abbreviated)
...fork_Osaka-eof_test
...fork_Osaka-eof_state_test
...fork_Osaka-eof_blockchain_test