Skip to content

test_jumpis()

Documentation for tests/benchmark/compute/instruction/test_control_flow.py::test_jumpis@8db70f93.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/benchmark/compute/instruction/test_control_flow.py::test_jumpis --gas-benchmark-values 1

Benchmark JUMPI instruction.

Source code in tests/benchmark/compute/instruction/test_control_flow.py
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
def test_jumpis(
    benchmark_test: BenchmarkTestFiller,
    pre: Alloc,
) -> None:
    """Benchmark JUMPI instruction."""
    tx = Transaction(
        to=pre.deploy_contract(
            code=(Op.JUMPDEST + Op.JUMPI(Op.PUSH0, Op.NUMBER))
        ),
        sender=pre.fund_eoa(),
    )

    benchmark_test(
        target_opcode=Op.JUMPI,
        tx=tx,
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 3 forks.