Skip to content

test_contract_create()

Documentation for tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_contract_create@v4.1.0.

Generate fixtures for these test cases for Prague with:

fill -v tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_contract_create --fork Prague

Test sending type-4 tx as a create transaction.

Source code in tests/prague/eip7702_set_code_tx/test_set_code_txs.py
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
def test_contract_create(
    state_test: StateTestFiller,
    pre: Alloc,
):
    """Test sending type-4 tx as a create transaction."""
    tx = Transaction(
        gas_limit=100_000,
        to=None,
        value=0,
        authorization_list=[],
        error=TransactionException.TYPE_4_TX_CONTRACT_CREATION,
        sender=pre.fund_eoa(),
    )

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

Parametrized Test Cases

This test case is only parametrized by fork and fixture format.

Test ID (Abbreviated)
...fork_Prague-state_test
...fork_Prague-blockchain_test_from_state_test
...fork_Osaka-state_test
...fork_Osaka-blockchain_test_from_state_test