test_swapn()
Documentation for tests/benchmark/compute/instruction/test_stack.py::test_swapn@ffe48572.
Generate fixtures for these test cases for Bogota with:
fill -v tests/benchmark/compute/instruction/test_stack.py::test_swapn --gas-benchmark-values 1
Benchmark SWAPN instruction.
Source code in tests/benchmark/compute/instruction/test_stack.py
| @pytest.mark.repricing
@pytest.mark.valid_from("Amsterdam")
@pytest.mark.parametrize(
"stack_index",
[17, 107, 235],
ids=lambda x: f"stack_{x}",
)
def test_swapn(
benchmark_test: BenchmarkTestFiller,
stack_index: int,
) -> None:
"""Benchmark SWAPN instruction."""
opcode = Op.SWAPN[stack_index]
benchmark_test(
target_opcode=Op.SWAPN,
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.