Skip to content

test_tx_gas_limit_cap_at_maximum()

Documentation for tests/osaka/eip7825_transaction_gas_limit_cap/test_eip_mainnet.py::test_tx_gas_limit_cap_at_maximum@892e6d1e.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7825_transaction_gas_limit_cap/test_eip_mainnet.py::test_tx_gas_limit_cap_at_maximum --fork Osaka

Test transaction at exactly the gas limit cap (2^24).

Source code in tests/osaka/eip7825_transaction_gas_limit_cap/test_eip_mainnet.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def test_tx_gas_limit_cap_at_maximum(
    state_test: StateTestFiller,
    pre: Alloc,
) -> None:
    """Test transaction at exactly the gas limit cap (2^24)."""
    storage = Storage()
    contract_address = pre.deploy_contract(
        code=Op.SSTORE(storage.store_next(1), 1) + Op.STOP,
    )

    tx = Transaction(
        ty=0x02,
        to=contract_address,
        sender=pre.fund_eoa(),
        gas_limit=Spec.tx_gas_limit_cap,
    )

    post = {
        contract_address: Account(storage=storage),
    }

    state_test(pre=pre, post=post, tx=tx)

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.