File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
tests/prague/eip7702_eoa_code_tx Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -652,6 +652,55 @@ def test_set_code_multiple_valid_authorization_tuples_same_signer(
652652 )
653653
654654
655+ def test_set_code_multiple_valid_authorization_tuples_first_invalid_same_signer (
656+ state_test : StateTestFiller ,
657+ pre : Alloc ,
658+ ):
659+ """
660+ Test setting the code of an account with multiple authorization tuples from the same signer
661+ but the first tuple is invalid.
662+ """
663+ signer = pre .fund_eoa (0 )
664+
665+ success_slot = 1
666+
667+ tuple_count = 10
668+
669+ addresses = [
670+ pre .deploy_contract (Op .SSTORE (success_slot , i + 1 ) + Op .STOP ) for i in range (tuple_count )
671+ ]
672+
673+ tx = Transaction (
674+ gas_limit = 1_000_000 ,
675+ to = signer ,
676+ value = 0 ,
677+ authorization_tuples = [
678+ AuthorizationTuple (
679+ address = address ,
680+ nonce = 1 if i == 0 else 0 ,
681+ signer = signer ,
682+ )
683+ for i , address in enumerate (addresses )
684+ ],
685+ sender = pre .fund_eoa (10 ** 18 ),
686+ )
687+
688+ state_test (
689+ env = Environment (),
690+ pre = pre ,
691+ tx = tx ,
692+ post = {
693+ signer : Account (
694+ nonce = 1 ,
695+ code = b"" ,
696+ storage = {
697+ success_slot : 2 ,
698+ },
699+ ),
700+ },
701+ )
702+
703+
655704@pytest .mark .parametrize (
656705 "invalidity_reason" ,
657706 list (InvalidityReasons ),
You can’t perform that action at this time.
0 commit comments