Skip to content

test_worst_jumps()

Documentation for tests/benchmark/test_worst_compute.py::test_worst_jumps@0f7c73a7.

Generate fixtures for these test cases for Prague with:

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

Test running a JUMP-intensive contract.

Source code in tests/benchmark/test_worst_compute.py
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
@pytest.mark.valid_from("Cancun")
@pytest.mark.slow
def test_worst_jumps(state_test: StateTestFiller, pre: Alloc):
    """Test running a JUMP-intensive contract."""
    env = Environment()

    jumps_code = Op.JUMPDEST + Op.JUMP(Op.PUSH0)
    jumps_address = pre.deploy_contract(jumps_code)

    tx = Transaction(
        to=jumps_address,
        gas_limit=env.gas_limit,
        sender=pre.fund_eoa(),
    )

    state_test(
        genesis_environment=env,
        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