Skip to content

test_worst_jumpis()

Documentation for tests/benchmark/test_worst_compute.py::test_worst_jumpis@v5.0.0.

Generate fixtures for these test cases for Osaka with:

fill -v tests/benchmark/test_worst_compute.py::test_worst_jumpis --fork Osaka

Test running a JUMPI-intensive contract.

Source code in tests/benchmark/test_worst_compute.py
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
@pytest.mark.valid_from("Cancun")
def test_worst_jumpis(
    state_test: StateTestFiller,
    pre: Alloc,
    gas_benchmark_value: int,
):
    """Test running a JUMPI-intensive contract."""
    jumpi_code = Op.JUMPDEST + Op.JUMPI(Op.PUSH0, Op.NUMBER)
    jumpi_address = pre.deploy_contract(jumpi_code)

    tx = Transaction(
        to=jumpi_address,
        gas_limit=gas_benchmark_value,
        sender=pre.fund_eoa(),
    )

    state_test(
        pre=pre,
        post={},
        tx=tx,
    )

Parametrized Test Cases

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

Test ID (Abbreviated)
...fork_Cancun-state_test
...fork_Cancun-blockchain_test_from_state_test
...fork_Prague-state_test
...fork_Prague-blockchain_test_from_state_test
...fork_Osaka-state_test
...fork_Osaka-blockchain_test_from_state_test