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@49a16fac.

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
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
@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