Skip to content

test_selfbalance()

Documentation for tests/benchmark/compute/instruction/test_account_query.py::test_selfbalance@8db70f93.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/benchmark/compute/instruction/test_account_query.py::test_selfbalance --gas-benchmark-values 1

Benchmark SELFBALANCE instruction.

Source code in tests/benchmark/compute/instruction/test_account_query.py
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@pytest.mark.repricing(contract_balance=1)
@pytest.mark.parametrize("contract_balance", [0, 1])
def test_selfbalance(
    benchmark_test: BenchmarkTestFiller,
    contract_balance: int,
) -> None:
    """Benchmark SELFBALANCE instruction."""
    benchmark_test(
        target_opcode=Op.SELFBALANCE,
        code_generator=ExtCallGenerator(
            attack_block=Op.SELFBALANCE,
            contract_balance=contract_balance,
        ),
    )

Parametrized Test Cases

This test generates 2 parametrized test cases across 3 forks.