Skip to content

test_double_rjumpi_stack_underflow()

Documentation for tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py::test_double_rjumpi_stack_underflow@b48d1dc8.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py::test_double_rjumpi_stack_underflow --fork Osaka

Two RJUMPIs, causing the min stack to underflow.

Source code in tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
def test_double_rjumpi_stack_underflow(
    eof_test: EOFTestFiller,
):
    """Two RJUMPIs, causing the min stack to underflow."""
    container = Container.Code(
        code=(
            Op.PUSH0  # (0, 0)
            + Op.PUSH0  # (1, 1)
            + Op.RJUMPI[5]  # (2, 2) To RETURN
            + Op.PUSH0  # (1, 1)
            + Op.PUSH0  # (2, 2)
            + Op.RJUMPI[0]  # (3, 3)
            + Op.RETURN  # (1, 2) Underflow
        ),
        max_stack_increase=3,
    )
    eof_test(
        container=container,
        expect_exception=EOFException.STACK_UNDERFLOW,
    )

Parametrized Test Cases

This test case is only parametrized by fork and fixture format.

Test ID (Abbreviated)
...fork_Osaka-eof_test
...fork_Osaka-state_test_from_eof_test
...fork_Osaka-blockchain_test_from_eof_test