Skip to content

test_worst_jumps()

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

Generate fixtures for these test cases for Osaka with:

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

Test running a JUMP-intensive contract.

Source code in tests/benchmark/test_worst_compute.py
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
@pytest.mark.valid_from("Cancun")
@pytest.mark.slow
def test_worst_jumps(
    state_test: StateTestFiller,
    pre: Alloc,
    gas_benchmark_value: int,
):
    """Test running a JUMP-intensive contract."""
    jumps_code = Op.JUMPDEST + Op.JUMP(Op.PUSH0)
    jumps_address = pre.deploy_contract(jumps_code)

    tx = Transaction(
        to=jumps_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