Skip to content

test_tx_into_chain_delegating_set_code()

Documentation for tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_tx_into_chain_delegating_set_code@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_tx_into_chain_delegating_set_code --fork Amsterdam

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

Source code in tests/prague/eip7702_set_code_tx/test_set_code_txs.py
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
def test_tx_into_chain_delegating_set_code(
    state_test: StateTestFiller,
    pre: Alloc,
) -> None:
    """
    Test a transaction that has entry-point into a set-code account that
    delegates to another set-code account.
    """
    auth_signer_1 = pre.fund_eoa(auth_account_start_balance)
    auth_signer_2 = pre.fund_eoa(auth_account_start_balance)

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

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

Parametrized Test Cases

This test generates 1 parametrized test case across 3 forks.