Skip to content

test_rjump_max_bytecode_size()

Documentation for tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py::test_rjump_max_bytecode_size@16d4f3bd.

Generate fixtures for these test cases for Osaka with:

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

EOF1V4200_0003 EOF with RJUMP containing the maximum offset that does not exceed the maximum bytecode size.

Source code in tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjump.py
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
def test_rjump_max_bytecode_size(
    eof_test: EOFTestFiller,
):
    """
    EOF1V4200_0003 EOF with RJUMP containing the maximum offset that does not exceed the maximum
    bytecode size.
    """
    noop_count = MAX_BYTECODE_SIZE - 27
    code = (
        Op.RJUMPI[RJUMP_LEN](Op.ORIGIN)  # The jumpi is to allow the NOOPs to be forward referenced
        + Op.RJUMP[len(Op.NOOP) * noop_count]
        + (Op.NOOP * noop_count)
        + Op.STOP
    )
    container = Container.Code(code)
    assert len(container) == MAX_BYTECODE_SIZE
    eof_test(container=container)

Parametrized Test Cases

This test case is only parametrized by fork.

Test ID (Abbreviated)
...fork_Osaka-eof_test