Skip to content

test_block_context_ops()

Documentation for tests/benchmark/compute/instruction/test_block_context.py::test_block_context_ops@7b8124a7.

Generate fixtures for these test cases for Osaka with:

fill -v tests/benchmark/compute/instruction/test_block_context.py::test_block_context_ops --gas-benchmark-values 1

Benchmark zero-parameter block context instructions.

Source code in tests/benchmark/compute/instruction/test_block_context.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@pytest.mark.repricing
@pytest.mark.parametrize(
    "opcode",
    [
        Op.COINBASE,
        Op.TIMESTAMP,
        Op.NUMBER,
        Op.PREVRANDAO,
        Op.GASLIMIT,
        Op.CHAINID,
        Op.BASEFEE,
        Op.BLOBBASEFEE,
    ],
)
def test_block_context_ops(
    benchmark_test: BenchmarkTestFiller,
    opcode: Op,
) -> None:
    """Benchmark zero-parameter block context instructions."""
    benchmark_test(
        target_opcode=opcode,
        code_generator=ExtCallGenerator(attack_block=opcode),
    )

Parametrized Test Cases

This test generates 8 parametrized test cases across 2 forks.