test_over_max_initcode_size_mainnet()
Documentation for tests/amsterdam/eip7954_increase_max_contract_size/test_eip_mainnet.py::test_over_max_initcode_size_mainnet@ffe48572.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip7954_increase_max_contract_size/test_eip_mainnet.py::test_over_max_initcode_size_mainnet --fork Amsterdam
Verify a CREATE transaction over the new initcode limit is rejected.
Source code in tests/amsterdam/eip7954_increase_max_contract_size/test_eip_mainnet.py
| @pytest.mark.inclusion_test
@pytest.mark.exception_test
def test_over_max_initcode_size_mainnet(
state_test: StateTestFiller,
pre: Alloc,
fork: Fork,
) -> None:
"""Verify a CREATE transaction over the new initcode limit is rejected."""
initcode = Initcode(
deploy_code=Op.STOP,
initcode_length=fork.max_initcode_size() + 1,
)
alice = pre.fund_eoa()
create_address = compute_create_address(address=alice, nonce=0)
tx = Transaction(
sender=alice,
to=None,
data=initcode,
gas_limit=fork.transaction_gas_limit_cap(),
error=TransactionException.INITCODE_SIZE_EXCEEDED,
)
post: dict[Any, Account | None] = {
create_address: Account.NONEXISTENT,
}
state_test(pre=pre, tx=tx, post=post)
|
Parametrized Test Cases
This test generates 1 parametrized test case across 1 fork.