Skip to content

test_bal_call_opcode_succeeds_in_static_context()

Documentation for tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_opcodes.py::test_bal_call_opcode_succeeds_in_static_context@c74f1a67.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_opcodes.py::test_bal_call_opcode_succeeds_in_static_context --fork Amsterdam

All call opcodes (without value) succeed in static context.

Target IS in BAL. Ensures clients don't over-restrict call opcodes beyond what EIP-214 forbids (only CALL with nonzero value).

Source code in tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_opcodes.py
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
@pytest.mark.with_all_call_opcodes
def test_bal_call_opcode_succeeds_in_static_context(
    pre: Alloc,
    blockchain_test: BlockchainTestFiller,
    call_opcode: Op,
) -> None:
    """
    All call opcodes (without value) succeed in static context.

    Target IS in BAL. Ensures clients don't over-restrict call opcodes
    beyond what EIP-214 forbids (only CALL with nonzero value).
    """
    target = pre.deploy_contract(code=Op.STOP)

    caller = pre.deploy_contract(
        code=call_opcode(address=target) + Op.STOP,
    )

    blockchain_test_under_static_call(
        pre,
        blockchain_test,
        static_call_target=caller,
        bal_expectations={
            target: BalAccountExpectation.empty(),
        },
    )

Parametrized Test Cases

This test generates 4 parametrized test cases across 1 fork.