Skip to content

test_double_rjumpi_stack_height_mismatch()

Documentation for tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py::test_double_rjumpi_stack_height_mismatch@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_height_mismatch --fork Osaka

Test stack height check of the backward RJUMP targeted by two RJUMPIs with the non-uniform stack height range.

Source code in tests/osaka/eip7692_eof_v1/eip4200_relative_jumps/test_rjumpi.py
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
def test_double_rjumpi_stack_height_mismatch(
    eof_test: EOFTestFiller,
):
    """
    Test stack height check of the backward RJUMP
    targeted by two RJUMPIs with the non-uniform stack height range.
    """
    eof_test(
        container=Container(
            sections=[
                Section.Code(
                    code=Op.PUSH0  # BEGIN: (0, 0)
                    + Op.PUSH0  # (1, 1)
                    + Op.RJUMPI[3]  # (2, 2) to LAST
                    + Op.RJUMPI[0]  # (1, 1) to LAST
                    + Op.RJUMP[-11],  # LAST: (0, 1) to BEGIN; stack height mismatch
                    max_stack_increase=2,
                ),
            ],
        ),
        expect_exception=EOFException.STACK_HEIGHT_MISMATCH,
    )

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