test_exchange()
Documentation for tests/benchmark/compute/instruction/test_stack.py::test_exchange@ffe48572.
Generate fixtures for these test cases for Bogota with:
fill -v tests/benchmark/compute/instruction/test_stack.py::test_exchange --gas-benchmark-values 1
Benchmark EXCHANGE instruction.
Source code in tests/benchmark/compute/instruction/test_stack.py
| @pytest.mark.repricing
@pytest.mark.valid_from("Amsterdam")
@pytest.mark.parametrize(
"n,m",
[
pytest.param(1, 2, id="n_1_m_2"),
pytest.param(1, 29, id="n_1_m_29"),
pytest.param(14, 16, id="n_14_m_16"),
],
)
def test_exchange(
benchmark_test: BenchmarkTestFiller,
n: int,
m: int,
) -> None:
"""Benchmark EXCHANGE instruction."""
opcode = Op.EXCHANGE[n, m]
benchmark_test(
target_opcode=Op.EXCHANGE,
code_generator=JumpLoopGenerator(
attack_block=opcode, setup=Op.PUSH0 * opcode.min_stack_height
),
)
|
Parametrized Test Cases
This test generates 3 parametrized test cases across 2 forks.