test_delegatecall_staticcall()
Documentation for tests/benchmark/compute/instruction/test_system.py::test_delegatecall_staticcall@ffe48572.
Generate fixtures for these test cases for Bogota with:
fill -v tests/benchmark/compute/instruction/test_system.py::test_delegatecall_staticcall --gas-benchmark-values 1
Benchmark a contract that STATICCALL/DELEGATECALL accounts.
Source code in tests/benchmark/compute/instruction/test_system.py
| @pytest.mark.parametrize("opcode", [Op.DELEGATECALL, Op.STATICCALL])
@pytest.mark.parametrize(
"warm_access",
[True, False],
)
def test_delegatecall_staticcall(
benchmark_test: BenchmarkTestFiller,
pre: Alloc,
opcode: Op,
warm_access: bool,
) -> None:
"""Benchmark a contract that STATICCALL/DELEGATECALL accounts."""
target = pre.deploy_contract(code=Op.STOP)
address = target if warm_access else Op.GAS
benchmark_test(
target_opcode=opcode,
code_generator=JumpLoopGenerator(
attack_block=Op.POP(
opcode(
gas=Op.GAS,
address=address,
)
),
),
)
|
Parametrized Test Cases
This test generates 4 parametrized test cases across 4 forks.