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@21fb11c8.

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
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
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_height=2,
                ),
            ],
        ),
        expect_exception=EOFException.STACK_HEIGHT_MISMATCH,
    )

Parametrized Test Cases

This test case is only parametrized by fork.

Test ID (Abbreviated)
...fork_Osaka-eof_test