Skip to content

test_tx_gas_limit_cap_exceeded()

Documentation for tests/osaka/eip7825_transaction_gas_limit_cap/test_eip_mainnet.py::test_tx_gas_limit_cap_exceeded@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_exceeded --fork Osaka

Test transaction exceeding the gas limit cap (2^24 + 1).

Source code in tests/osaka/eip7825_transaction_gas_limit_cap/test_eip_mainnet.py
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@pytest.mark.exception_test
def test_tx_gas_limit_cap_exceeded(
    state_test: StateTestFiller,
    pre: Alloc,
) -> None:
    """Test transaction exceeding the gas limit cap (2^24 + 1)."""
    contract_address = pre.deploy_contract(
        code=Op.SSTORE(0, 1) + Op.STOP,
    )

    tx = Transaction(
        ty=0x02,
        to=contract_address,
        sender=pre.fund_eoa(),
        gas_limit=Spec.tx_gas_limit_cap + 1,
        error=TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM,
    )

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

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.