Skip to content

test_contract_create()

Documentation for tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_contract_create@v5.0.0.

Generate fixtures for these test cases for Osaka with:

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

Test sending type-4 tx as a create transaction.

Source code in tests/prague/eip7702_set_code_tx/test_set_code_txs.py
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
@pytest.mark.exception_test
def test_contract_create(
    state_test: StateTestFiller,
    pre: Alloc,
):
    """Test sending type-4 tx as a create transaction."""
    authorization_tuple = AuthorizationTuple(
        address=Address(0x01),
        nonce=0,
        signer=pre.fund_eoa(),
    )
    tx = Transaction(
        gas_limit=100_000,
        to=None,
        value=0,
        authorization_list=[authorization_tuple],
        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