Skip to content

test_rjumpv_into_dupn()

Documentation for tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpv.py::test_rjumpv_into_dupn@verkle@v0.0.6.

Generate fixtures for these test cases for Pragueeip7692 with:

Pragueeip7692 only:

fill -v tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpv.py::test_rjumpv_into_dupn --fork=PragueEIP7692 --evm-bin=/path/to/evm-tool-dev-version

For all forks up to and including Pragueeip7692:

fill -v tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpv.py::test_rjumpv_into_dupn --until=PragueEIP7692

EOF code containing RJUMP with target DUPN immediate

Source code in tests/prague/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpv.py
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
@pytest.mark.parametrize(
    "table_size,invalid_index",
    [
        pytest.param(1, 0, id="t1i0"),
        pytest.param(256, 0, id="t256i0"),
        pytest.param(256, 255, id="t256i255"),
    ],
)
def test_rjumpv_into_dupn(
    eof_test: EOFTestFiller,
    table_size: int,
    invalid_index: int,
):
    """EOF code containing RJUMP with target DUPN immediate"""
    invalid_destination = 1
    jump_table = [0 for _ in range(table_size)]
    jump_table[invalid_index] = invalid_destination
    eof_test(
        data=Container(
            sections=[
                Section.Code(
                    code=Op.PUSH1(1)
                    + Op.PUSH1(1)
                    + Op.PUSH1(0)
                    + Op.RJUMPV[jump_table]
                    + Op.DUPN[1]
                    + Op.SSTORE
                    + Op.STOP,
                ),
            ],
        ),
        expect_exception=EOFException.INVALID_RJUMP_DESTINATION,
    )

Parametrized Test Cases

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

Skipped Parameters

For more concise readability, the table below does not list the following parameter values: fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.

Test ID table_size invalid_index
t1i0 1 0
t256i0 256 0
t256i255 256 255