Skip to content

test_deploying_delegation_designation_contract()

Documentation for tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_deploying_delegation_designation_contract@008e492e.

Generate fixtures for these test cases for Prague with:

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

Test attempting to deploy a contract that has the same format as a delegation designation.

Source code in tests/prague/eip7702_set_code_tx/test_set_code_txs.py
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
def test_deploying_delegation_designation_contract(
    state_test: StateTestFiller,
    pre: Alloc,
):
    """
    Test attempting to deploy a contract that has the same format as a
    delegation designation.
    """
    sender = pre.fund_eoa()

    set_to_code = Op.RETURN(0, 1)
    set_to_address = pre.deploy_contract(set_to_code)

    initcode = Initcode(deploy_code=Spec.delegation_designation(set_to_address))

    tx = Transaction(
        sender=sender,
        to=None,
        gas_limit=100_000,
        data=initcode,
    )

    state_test(
        env=Environment(),
        pre=pre,
        tx=tx,
        post={
            sender: Account(
                nonce=1,
            ),
            tx.created_contract: Account.NONEXISTENT,
        },
    )

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