test_callvalue_from_call()
Documentation for tests/benchmark/compute/instruction/test_call_context.py::test_callvalue_from_call@ffe48572.
Generate fixtures for these test cases for Bogota with:
fill -v tests/benchmark/compute/instruction/test_call_context.py::test_callvalue_from_call --gas-benchmark-values 1
Benchmark CALLVALUE instruction from call.
Source code in tests/benchmark/compute/instruction/test_call_context.py
| @pytest.mark.parametrize("non_zero_value", [True, False])
def test_callvalue_from_call(
benchmark_test: BenchmarkTestFiller,
pre: Alloc,
non_zero_value: bool,
fork: Fork,
) -> None:
"""
Benchmark CALLVALUE instruction from call.
"""
code_address = pre.deploy_contract(
code=Op.CALLVALUE * fork.max_stack_height()
)
benchmark_test(
code_generator=JumpLoopGenerator(
attack_block=Op.POP(
Op.CALL(
address=code_address,
value=int(non_zero_value),
args_offset=Op.PUSH0,
args_size=Op.PUSH0,
ret_offset=Op.PUSH0,
ret_size=Op.PUSH0,
)
),
tx_kwargs={"value": 10**18},
),
)
|
Parametrized Test Cases
This test generates 2 parametrized test cases across 4 forks.