Skip to content

test_worst_selfbalance()

Documentation for tests/benchmark/test_worst_stateful_opcodes.py::test_worst_selfbalance@88e9fb8f.

Generate fixtures for these test cases for Osaka with:

fill -v tests/benchmark/test_worst_stateful_opcodes.py::test_worst_selfbalance -m benchmark

Test running a block with as many SELFBALANCE opcodes as possible.

Source code in tests/benchmark/test_worst_stateful_opcodes.py
454
455
456
457
458
459
460
461
462
463
464
465
@pytest.mark.parametrize("contract_balance", [0, 1])
def test_worst_selfbalance(
    benchmark_test: BenchmarkTestFiller,
    contract_balance: int,
) -> None:
    """Test running a block with as many SELFBALANCE opcodes as possible."""
    benchmark_test(
        code_generator=ExtCallGenerator(
            attack_block=Op.SELFBALANCE,
            contract_balance=contract_balance,
        ),
    )

Parametrized Test Cases

This test case is only parametrized by fork.

Test ID (Abbreviated) contract_balance
...fork_Prague-blockchain_test-contract_balance_0 0
...fork_Prague-blockchain_test-contract_balance_1 1
...fork_Osaka-blockchain_test-contract_balance_0 0
...fork_Osaka-blockchain_test-contract_balance_1 1