test_calldataload()
Documentation for tests/benchmark/compute/instruction/test_call_context.py::test_calldataload@ffe48572.
Generate fixtures for these test cases for Bogota with:
fill -v tests/benchmark/compute/instruction/test_call_context.py::test_calldataload --gas-benchmark-values 1
Benchmark CALLDATALOAD instruction.
Source code in tests/benchmark/compute/instruction/test_call_context.py
| @pytest.mark.repricing(zero_data=True)
@pytest.mark.parametrize("calldata_size", [0, 32, 256, 1024])
@pytest.mark.parametrize("zero_data", [True, False])
def test_calldataload(
benchmark_test: BenchmarkTestFiller, calldata_size: int, zero_data: bool
) -> None:
"""Benchmark CALLDATALOAD instruction."""
calldata = (
b"\x00" * calldata_size
if zero_data
else Bytes([i % 256 for i in range(calldata_size)])
)
benchmark_test(
target_opcode=Op.CALLDATALOAD,
code_generator=ExtCallGenerator(
attack_block=Op.CALLDATALOAD(Op.PUSH0),
tx_kwargs={"data": calldata},
),
)
|
Parametrized Test Cases
This test generates 8 parametrized test cases across 4 forks.