Skip to content

test_rjump_into_rjumpv()

Documentation for tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_into_rjumpv@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_rjumpv --fork Osaka

EOF1I4200_0012 (Invalid) EOF code containing RJUMP with target RJUMPV immediate.

Source code in tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
@pytest.mark.parametrize("target_rjumpv_table_size", [1, 256])
@pytest.mark.parametrize(
    "data_portion_end",
    [True, False],
    ids=["data_portion_end", "data_portion_start"],
)
def test_rjump_into_rjumpv(
    eof_test: EOFTestFiller,
    target_rjumpv_table_size: int,
    data_portion_end: bool,
):
    """EOF1I4200_0012 (Invalid) EOF code containing RJUMP with target RJUMPV immediate."""
    invalid_destination = 4 + (2 * target_rjumpv_table_size) if data_portion_end else 4
    target_jump_table = [0 for _ in range(target_rjumpv_table_size)]
    eof_test(
        container=Container.Code(
            Op.RJUMP[invalid_destination]
            + Op.STOP
            + Op.PUSH1(1)
            + Op.RJUMPV[target_jump_table]
            + Op.STOP,
        ),
        expect_exception=EOFException.INVALID_RJUMP_DESTINATION,
    )

Parametrized Test Cases

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

Test ID (Abbreviated) data_portion_end target_rjumpv_table_size
...fork_Osaka-eof_test-data_portion_end-target_rjumpv_table_size_1 True 1
...fork_Osaka-eof_test-data_portion_end-target_rjumpv_table_size_256 True 256
...fork_Osaka-eof_test-data_portion_start-target_rjumpv_table_size_1 False 1
...fork_Osaka-eof_test-data_portion_start-target_rjumpv_table_size_256 False 256