Skip to content

test_iszero()

Documentation for tests/benchmark/compute/instruction/test_comparison.py::test_iszero@8db70f93.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/benchmark/compute/instruction/test_comparison.py::test_iszero --gas-benchmark-values 1

Benchmark ISZERO instruction (takes one arg, pushes one value).

Source code in tests/benchmark/compute/instruction/test_comparison.py
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@pytest.mark.repricing
def test_iszero(
    benchmark_test: BenchmarkTestFiller,
) -> None:
    """
    Benchmark ISZERO instruction (takes one arg, pushes one value).
    """
    benchmark_test(
        target_opcode=Op.ISZERO,
        code_generator=JumpLoopGenerator(
            setup=Op.PUSH0,
            attack_block=Op.ISZERO,
        ),
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 3 forks.