Skip to content

test_create_tx_state_gas()

Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_create.py::test_create_tx_state_gas@2119b382.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_create.py::test_create_tx_state_gas --fork Amsterdam

Test contract creation transaction charges intrinsic state gas.

A create transaction (to=None) charges new-account state gas as intrinsic state gas for the new account, plus code deposit state gas for the deployed bytecode.

Source code in tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_create.py
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
@pytest.mark.valid_from("EIP8037")
def test_create_tx_state_gas(
    state_test: StateTestFiller,
    pre: Alloc,
) -> None:
    """
    Test contract creation transaction charges intrinsic state gas.

    A create transaction (to=None) charges new-account state gas
    as intrinsic state gas for the new account, plus code deposit state
    gas for the deployed bytecode.
    """
    tx = Transaction(
        to=None,
        data=Op.STOP,
        state_gas_reservoir=0,
        sender=pre.fund_eoa(),
    )

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

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.