Skip to content

test_worst_jumps()

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

Generate fixtures for these test cases for Osaka with:

fill -v tests/benchmark/test_worst_compute.py::test_worst_jumps -m benchmark

Test running a JUMP-intensive contract.

Source code in tests/benchmark/test_worst_compute.py
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
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_Prague-state_test
...fork_Prague-blockchain_test_from_state_test
...fork_Osaka-state_test
...fork_Osaka-blockchain_test_from_state_test