Skip to content

test_rjump_into_push_1()

Documentation for tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_into_push_1@49a16fac.

Generate fixtures for these test cases for Osaka with:

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

EOF1I4200_0011 (Invalid) EOF code containing RJUMP with target PUSH1 immediate.

Source code in tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py
329
330
331
332
333
334
335
336
337
338
@pytest.mark.parametrize("jump", [JumpDirection.FORWARD, JumpDirection.BACKWARD])
def test_rjump_into_push_1(eof_test: EOFTestFiller, jump: JumpDirection):
    """EOF1I4200_0011 (Invalid) EOF code containing RJUMP with target PUSH1 immediate."""
    code = (
        Op.PUSH1[1] + Op.RJUMP[-4] if jump == JumpDirection.BACKWARD else Op.RJUMP[1] + Op.PUSH1[1]
    ) + Op.STOP
    eof_test(
        container=Container.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