Skip to content

test_worst_jumpis()

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

Generate fixtures for these test cases for Osaka with:

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

Test running a JUMPI-intensive contract.

Source code in tests/benchmark/test_worst_compute.py
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
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_Prague-state_test
...fork_Prague-blockchain_test_from_state_test
...fork_Osaka-state_test
...fork_Osaka-blockchain_test_from_state_test