Skip to content

test_intrinsic_charges_authority_in_access_list()

Documentation for tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_warmth_invariants.py::test_intrinsic_charges_authority_in_access_list@26332146.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_warmth_invariants.py::test_intrinsic_charges_authority_in_access_list --fork Amsterdam

Authority is listed in the access list. The intrinsic charge still includes the full EXECUTION_PER_AUTH_BASE_COST, whose folded-in authority access is charged at the cold rate.

Source code in tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/test_warmth_invariants.py
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
def test_intrinsic_charges_authority_in_access_list(
    fork: Fork,
    pre: Alloc,
    state_test: StateTestFiller,
) -> None:
    """
    Authority is listed in the access list. The intrinsic charge still
    includes the full ``EXECUTION_PER_AUTH_BASE_COST``, whose folded-in
    authority access is charged at the cold rate.
    """
    sender = pre.fund_eoa()
    recipient = pre.deploy_contract(code=Op.STOP)

    scenario = build_authorization(
        pre, AuthorizationAction.SETS_NEW_DELEGATION
    )
    authorization_list = [scenario.authorization]
    access_list = [AccessList(address=scenario.authority, storage_keys=[])]

    total_gas_cost = authorization_transaction_cost(
        fork, authorization_list, access_list=access_list
    )

    tx = Transaction(
        ty=4,
        sender=sender,
        to=recipient,
        value=0,
        access_list=access_list,
        authorization_list=authorization_list,
        gas_limit=total_gas_cost,
        expected_receipt=TransactionReceipt(
            cumulative_gas_used=total_gas_cost,
        ),
    )

    post = {
        scenario.authority: scenario.applied_account,
    }

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

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.