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@892e6d1e.

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
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
@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.