Skip to content

test_invalid_tx_invalid_auth_signature()

Documentation for tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_invalid_tx_invalid_auth_signature@verkle@v0.0.6.

Generate fixtures for these test cases for Prague with:

Prague only:

fill -v tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_invalid_tx_invalid_auth_signature --fork=Prague --evm-bin=/path/to/evm-tool-dev-version

For all forks up to and including Prague:

fill -v tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_invalid_tx_invalid_auth_signature --until=Prague

Test sending a transaction to set the code of an account using synthetic signatures.

Source code in tests/prague/eip7702_set_code_tx/test_set_code_txs.py
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
@pytest.mark.parametrize(
    "v,r,s",
    [
        pytest.param(2, 1, 1, id="v_2,r_1,s_1"),
        pytest.param(
            0,
            1,
            SECP256K1N_OVER_2 + 1,
            id="v_0,r_1,s_SECP256K1N_OVER_2+1",
        ),
        pytest.param(
            2**256 - 1,
            1,
            1,
            id="v_2**256-1,r_1,s_1",
        ),
        pytest.param(
            0,
            1,
            2**256 - 1,
            id="v_0,r_1,s_2**256-1",
        ),
    ],
)
def test_invalid_tx_invalid_auth_signature(
    state_test: StateTestFiller,
    pre: Alloc,
    v: int,
    r: int,
    s: int,
):
    """
    Test sending a transaction to set the code of an account using synthetic signatures.
    """
    success_slot = 1

    callee_code = Op.SSTORE(success_slot, 1) + Op.STOP
    callee_address = pre.deploy_contract(callee_code)

    authorization_tuple = AuthorizationTuple(
        address=0,
        nonce=0,
        chain_id=1,
        v=v,
        r=r,
        s=s,
    )

    tx = Transaction(
        gas_limit=100_000,
        to=callee_address,
        value=0,
        authorization_list=[authorization_tuple],
        error=TransactionException.TYPE_4_INVALID_AUTHORITY_SIGNATURE,
        sender=pre.fund_eoa(),
    )

    state_test(
        env=Environment(),
        pre=pre,
        tx=tx,
        post={
            callee_address: Account(
                storage={success_slot: 0},
            ),
        },
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Skipped Parameters

For more concise readability, the table below does not list the following parameter values: fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.

Test ID v r s
v_2,r_1,s_1 2 1 1
v_0,r_1,s_SECP256K1N_OVER_2+1 0 1 57896044618658097711785492504343953926418782139537452191302581570759080747169
v_2**256-1,r_1,s_1 115792089237316195423570985008687907853269984665640564039457584007913129639935 1 1
v_0,r_1,s_2**256-1 0 1 115792089237316195423570985008687907853269984665640564039457584007913129639935
v_2,r_1,s_1 2 1 1
v_0,r_1,s_SECP256K1N_OVER_2+1 0 1 57896044618658097711785492504343953926418782139537452191302581570759080747169
v_2**256-1,r_1,s_1 115792089237316195423570985008687907853269984665640564039457584007913129639935 1 1
v_0,r_1,s_2**256-1 0 1 115792089237316195423570985008687907853269984665640564039457584007913129639935