Skip to content

test_auth_installs_delegation()

Documentation for tests/amsterdam/eip8038_state_access_gas_cost_increase/test_eip_mainnet.py::test_auth_installs_delegation@26332146.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip8038_state_access_gas_cost_increase/test_eip_mainnet.py::test_auth_installs_delegation --fork Amsterdam

A single valid 7702 authorization pays the EIP-8038 auth intrinsic and installs a delegation designation on the authority.

Source code in tests/amsterdam/eip8038_state_access_gas_cost_increase/test_eip_mainnet.py
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
@EIPChecklist.GasCostChanges.Test.GasUpdatesMeasurement()
def test_auth_installs_delegation(
    state_test: StateTestFiller,
    pre: Alloc,
) -> None:
    """
    A single valid ``7702`` authorization pays the EIP-8038 auth
    intrinsic and installs a delegation designation on the authority.
    """
    auth_signer = pre.fund_eoa()
    set_code_to = pre.deploy_contract(code=Op.STOP)

    authorization_list = [
        AuthorizationTuple(
            address=set_code_to,
            nonce=0,
            signer=auth_signer,
        ),
    ]

    tx = Transaction(
        to=auth_signer,
        gas_limit=1_000_000,
        authorization_list=authorization_list,
        sender=pre.fund_eoa(),
    )

    post = {
        auth_signer: Account(
            nonce=1,
            code=Spec7702.delegation_designation(set_code_to),
        ),
    }
    state_test(pre=pre, post=post, tx=tx)

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.