Skip to content

test_rjumpi_into_push_1()

Documentation for tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py::test_rjumpi_into_push_1@3719e927.

Generate fixtures for these test cases for Osaka with:

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

EOF1I4200_0024 (Invalid) EOF code containing RJUMPI with target PUSH1 immediate.

Source code in tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
@pytest.mark.parametrize("jump", [JumpDirection.FORWARD, JumpDirection.BACKWARD])
def test_rjumpi_into_push_1(
    eof_test: EOFTestFiller,
    jump: JumpDirection,
):
    """EOF1I4200_0024 (Invalid) EOF code containing RJUMPI with target PUSH1 immediate."""
    code = (
        Op.PUSH1[1] + Op.RJUMPI[-4]
        if jump == JumpDirection.BACKWARD
        else Op.PUSH1[1] + Op.RJUMPI[1] + Op.PUSH1[1] + Op.POP
    ) + Op.STOP
    eof_test(
        container=Container(
            sections=[
                Section.Code(code=code),
            ],
        ),
        expect_exception=EOFException.INVALID_RJUMP_DESTINATION,
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) jump
...fork_Osaka-eof_test-jump_JumpDirection.FORWARD JumpDirection.FORWARD
...fork_Osaka-eof_test-jump_JumpDirection.BACKWARD JumpDirection.BACKWARD
...fork_Osaka-state_test_from_eof_test-jump_JumpDirection.FORWARD JumpDirection.FORWARD
...fork_Osaka-state_test_from_eof_test-jump_JumpDirection.BACKWARD JumpDirection.BACKWARD
...fork_Osaka-blockchain_test_from_eof_test-jump_JumpDirection.FORWARD JumpDirection.FORWARD
...fork_Osaka-blockchain_test_from_eof_test-jump_JumpDirection.BACKWARD JumpDirection.BACKWARD