From 1bdec8007082eeb4c793abf2e576e8d28876481e Mon Sep 17 00:00:00 2001 From: danceratopz Date: Fri, 20 Dec 2024 16:59:19 +0100 Subject: [PATCH] chore(tests): EIP-7702: update auth.chainid in set code txs to u256 (#1026) * chore(tests): update chainid in 7702 set code txs to u256 * refactor(tests): rename `MAX_CHAIN_ID` to `MAX_AUTH_CHAIN_ID` * refactor(tests): rename chain_id to auth_chain_id --- tests/prague/eip7702_set_code_tx/spec.py | 2 +- tests/prague/eip7702_set_code_tx/test_invalid_tx.py | 11 +++++------ tests/prague/eip7702_set_code_tx/test_set_code_txs.py | 8 ++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/prague/eip7702_set_code_tx/spec.py b/tests/prague/eip7702_set_code_tx/spec.py index 5cbd68fd50..e1f6100db0 100644 --- a/tests/prague/eip7702_set_code_tx/spec.py +++ b/tests/prague/eip7702_set_code_tx/spec.py @@ -34,7 +34,7 @@ class Spec: DELEGATION_DESIGNATION_READING = Bytes("ef01") RESET_DELEGATION_ADDRESS = Address(0) - MAX_CHAIN_ID = 2**64 - 1 + MAX_AUTH_CHAIN_ID = 2**256 - 1 MAX_NONCE = 2**64 - 1 @staticmethod diff --git a/tests/prague/eip7702_set_code_tx/test_invalid_tx.py b/tests/prague/eip7702_set_code_tx/test_invalid_tx.py index b2c9c61707..2a13709344 100644 --- a/tests/prague/eip7702_set_code_tx/test_invalid_tx.py +++ b/tests/prague/eip7702_set_code_tx/test_invalid_tx.py @@ -102,10 +102,9 @@ def test_invalid_auth_signature( @pytest.mark.parametrize( - "chain_id", + "auth_chain_id", [ - pytest.param(Spec.MAX_CHAIN_ID + 1, id="chain_id=2**64"), - pytest.param(2**256, id="chain_id=2**256"), + pytest.param(Spec.MAX_AUTH_CHAIN_ID + 1, id="auth_chain_id=2**256"), ], ) @pytest.mark.parametrize( @@ -115,10 +114,10 @@ def test_invalid_auth_signature( pytest.param(Address(1), id="non_zero_address"), ], ) -def test_invalid_tx_invalid_chain_id( +def test_invalid_tx_invalid_auth_chain_id( transaction_test: TransactionTestFiller, pre: Alloc, - chain_id: int, + auth_chain_id: int, delegate_address: Address, ): """ @@ -128,7 +127,7 @@ def test_invalid_tx_invalid_chain_id( authorization = AuthorizationTuple( address=delegate_address, nonce=0, - chain_id=chain_id, + chain_id=auth_chain_id, signer=pre.fund_eoa(auth_account_start_balance), ) diff --git a/tests/prague/eip7702_set_code_tx/test_set_code_txs.py b/tests/prague/eip7702_set_code_tx/test_set_code_txs.py index ee819b3d71..700573cf13 100644 --- a/tests/prague/eip7702_set_code_tx/test_set_code_txs.py +++ b/tests/prague/eip7702_set_code_tx/test_set_code_txs.py @@ -2274,16 +2274,16 @@ def test_signature_s_out_of_range( @pytest.mark.parametrize( - "chain_id", + "auth_chain_id", [ - pytest.param(Spec.MAX_CHAIN_ID, id="chain_id=2**64-1"), + pytest.param(Spec.MAX_AUTH_CHAIN_ID, id="auth_chain_id=2**256-1"), pytest.param(2, id="chain_id=2"), ], ) def test_valid_tx_invalid_chain_id( state_test: StateTestFiller, pre: Alloc, - chain_id: int, + auth_chain_id: int, ): """ Test sending a transaction where the chain id field does not match the current chain's id. @@ -2299,7 +2299,7 @@ def test_valid_tx_invalid_chain_id( authorization = AuthorizationTuple( address=set_code_to_address, nonce=0, - chain_id=chain_id, + chain_id=auth_chain_id, signer=auth_signer, )