From 03277f5194725069e212ed393277553b1483c731 Mon Sep 17 00:00:00 2001 From: sonhv0212 Date: Thu, 22 May 2025 16:24:34 +0700 Subject: [PATCH 1/2] fix(tests): EIP-7702: test_reset_code sends txs in diffent blocks --- .../eip7702_set_code_tx/test_set_code_txs.py | 65 +++++++++++-------- 1 file changed, 37 insertions(+), 28 deletions(-) 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 b57f58e2ab1..878956fce3c 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 @@ -2890,46 +2890,55 @@ def test_reset_code( sender = pre.fund_eoa(10**19) - txs = [ - Transaction( - sender=sender, - gas_limit=1_000_000, - to=auth_signer, - value=0, - authorization_list=[ - AuthorizationTuple( - address=set_code_1_address, - nonce=0, - signer=auth_signer, - ), - ], + blocks = [] + blocks.append( + Block( + txs=[ + Transaction( + sender=sender, + gas_limit=1_000_000, + to=auth_signer, + value=0, + authorization_list=[ + AuthorizationTuple( + address=set_code_1_address, + nonce=0, + signer=auth_signer, + ), + ], + ) + ] ) - ] + ) auth_signer.nonce += 1 # type: ignore if self_sponsored: sender = auth_signer - txs.append( - Transaction( - sender=sender, - gas_limit=1_000_000, - to=auth_signer, - value=0, - authorization_list=[ - AuthorizationTuple( - address=set_code_2_address, - nonce=auth_signer.nonce + 1 if self_sponsored else auth_signer.nonce, - signer=auth_signer, + blocks.append( + Block( + txs=[ + Transaction( + sender=sender, + gas_limit=1_000_000, + to=auth_signer, + value=0, + authorization_list=[ + AuthorizationTuple( + address=set_code_2_address, + nonce=auth_signer.nonce + 1 if self_sponsored else auth_signer.nonce, + signer=auth_signer, + ), + ], ), - ], - ), + ] + ) ) blockchain_test( pre=pre, - blocks=[Block(txs=txs)], + blocks=blocks, post={ auth_signer: Account( nonce=3 if self_sponsored else 2, From 2e644fc8d688fea3f1790d071aa5750b45f64183 Mon Sep 17 00:00:00 2001 From: sonhv0212 Date: Thu, 22 May 2025 16:30:48 +0700 Subject: [PATCH 2/2] fix(tests): EIP-7702: modify contract code of test_empty_authorization_list --- tests/prague/eip7702_set_code_tx/test_set_code_txs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 878956fce3c..9306c8c0388 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 @@ -2983,7 +2983,7 @@ def test_empty_authorization_list( """Test sending an invalid transaction with empty authorization list.""" tx = Transaction( gas_limit=100_000, - to=pre.deploy_contract(code=b""), + to=pre.deploy_contract(Bytecode()), value=0, authorization_list=[], error=TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST,