Skip to content

test_tx_into_self_delegating_set_code()

Documentation for tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_tx_into_self_delegating_set_code@88e9fb8f.

Generate fixtures for these test cases for Osaka with:

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

Test a transaction that has entry-point into a set-code account that delegates to itself.

Source code in tests/prague/eip7702_set_code_tx/test_set_code_txs.py
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
def test_tx_into_self_delegating_set_code(
    state_test: StateTestFiller,
    pre: Alloc,
) -> None:
    """
    Test a transaction that has entry-point into a set-code account that
    delegates to itself.
    """
    auth_signer = pre.fund_eoa(auth_account_start_balance)

    tx = Transaction(
        gas_limit=10_000_000,
        to=auth_signer,
        value=0,
        authorization_list=[
            AuthorizationTuple(
                address=auth_signer,
                nonce=0,
                signer=auth_signer,
            ),
        ],
        sender=pre.fund_eoa(),
    )

    state_test(
        env=Environment(),
        pre=pre,
        tx=tx,
        post={
            auth_signer: Account(
                nonce=1,
                code=Spec.delegation_designation(auth_signer),
            ),
        },
    )

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