@@ -50,72 +50,98 @@ test('account API assert defaults', async t => {
5050 t . is ( account . print ( account . defaults ) , account . print ( ) ) ;
5151} ) ;
5252
53- for ( const signer of [ false , 'ERC7702' , 'ECDSA' , 'P256' , 'RSA' , 'Multisig' , 'MultisigWeighted' ] as const ) {
54- let title = 'Account' ;
55- if ( signer ) {
56- title += ` with Signer${ signer } ` ;
53+ function format ( upgradeable : false | 'uups' | 'transparent' ) {
54+ switch ( upgradeable ) {
55+ case false :
56+ return 'non-upgradeable' ;
57+ case 'uups' :
58+ return 'upgradeable uups' ;
59+ case 'transparent' :
60+ return 'upgradeable transparent' ;
5761 }
62+ }
5863
59- testAccount ( `${ title } named` , {
60- name : `Custom${ title } ` ,
61- signer,
62- } ) ;
63-
64- testAccount ( `${ title } with ERC1271` , {
65- name : `Custom${ title } ERC1271` ,
66- signatureValidation : 'ERC1271' ,
67- signer,
68- } ) ;
69-
70- testAccount ( `${ title } with ERC7739` , {
71- name : `Custom${ title } ERC7739` ,
72- signatureValidation : 'ERC7739' ,
73- signer,
74- } ) ;
75-
76- testAccount ( `${ title } with ERC721Holder` , {
77- name : `Custom${ title } ERC721Holder` ,
78- ERC721Holder : true ,
79- signer,
80- } ) ;
81-
82- testAccount ( `${ title } with ERC1155Holder` , {
83- name : `Custom${ title } ERC1155Holder` ,
84- ERC1155Holder : true ,
85- signer,
86- } ) ;
87-
88- testAccount ( `${ title } with ERC721Holder and ERC1155Holder` , {
89- name : `Custom${ title } ERC721HolderERC1155Holder` ,
90- ERC721Holder : true ,
91- ERC1155Holder : true ,
92- signer,
93- } ) ;
94-
95- testAccount ( `${ title } with ERC7821 Execution` , {
96- signer,
97- batchedExecution : true ,
98- } ) ;
99-
100- testAccount ( `${ title } with ERC7579` , {
101- signer,
102- ERC7579Modules : 'AccountERC7579' ,
103- } ) ;
104-
105- testAccount ( `${ title } with ERC7579 with ERC1271` , {
106- signer,
107- ERC7579Modules : 'AccountERC7579' ,
108- signatureValidation : 'ERC1271' ,
109- } ) ;
110-
111- testAccount ( `${ title } with ERC7579 with ERC7739` , {
112- signer,
113- ERC7579Modules : 'AccountERC7579' ,
114- signatureValidation : 'ERC7739' ,
115- } ) ;
116-
117- testAccount ( `${ title } with ERC7579 hooks` , {
118- signer,
119- ERC7579Modules : 'AccountERC7579Hooked' ,
120- } ) ;
64+ for ( const signer of [ false , 'ERC7702' , 'ECDSA' , 'P256' , 'RSA' , 'Multisig' , 'MultisigWeighted' ] as const ) {
65+ for ( const upgradeable of [ false , 'uups' , 'transparent' ] as const ) {
66+ if ( signer === 'ERC7702' && ! ! upgradeable ) continue ;
67+
68+ let title = 'Account' ;
69+ if ( signer ) {
70+ title += ` with Signer${ signer } ` ;
71+ }
72+
73+ testAccount ( `${ title } named ${ format ( upgradeable ) } ` , {
74+ name : `Custom${ title } ` ,
75+ signer,
76+ upgradeable,
77+ } ) ;
78+
79+ testAccount ( `${ title } with ERC1271 ${ format ( upgradeable ) } ` , {
80+ name : `Custom${ title } ERC1271` ,
81+ signatureValidation : 'ERC1271' ,
82+ signer,
83+ upgradeable,
84+ } ) ;
85+
86+ testAccount ( `${ title } with ERC7739 ${ format ( upgradeable ) } ` , {
87+ name : `Custom${ title } ERC7739` ,
88+ signatureValidation : 'ERC7739' ,
89+ signer,
90+ upgradeable,
91+ } ) ;
92+
93+ testAccount ( `${ title } with ERC721Holder ${ format ( upgradeable ) } ` , {
94+ name : `Custom${ title } ERC721Holder` ,
95+ ERC721Holder : true ,
96+ signer,
97+ upgradeable,
98+ } ) ;
99+
100+ testAccount ( `${ title } with ERC1155Holder ${ format ( upgradeable ) } ` , {
101+ name : `Custom${ title } ERC1155Holder` ,
102+ ERC1155Holder : true ,
103+ signer,
104+ upgradeable,
105+ } ) ;
106+
107+ testAccount ( `${ title } with ERC721Holder and ERC1155Holder ${ format ( upgradeable ) } ` , {
108+ name : `Custom${ title } ERC721HolderERC1155Holder` ,
109+ ERC721Holder : true ,
110+ ERC1155Holder : true ,
111+ signer,
112+ upgradeable,
113+ } ) ;
114+
115+ testAccount ( `${ title } with ERC7821 Execution ${ format ( upgradeable ) } ` , {
116+ signer,
117+ upgradeable,
118+ batchedExecution : true ,
119+ } ) ;
120+
121+ testAccount ( `${ title } with ERC7579 ${ format ( upgradeable ) } ` , {
122+ signer,
123+ upgradeable,
124+ ERC7579Modules : 'AccountERC7579' ,
125+ } ) ;
126+
127+ testAccount ( `${ title } with ERC7579 with ERC1271 ${ format ( upgradeable ) } ` , {
128+ signer,
129+ upgradeable,
130+ ERC7579Modules : 'AccountERC7579' ,
131+ signatureValidation : 'ERC1271' ,
132+ } ) ;
133+
134+ testAccount ( `${ title } with ERC7579 with ERC7739 ${ format ( upgradeable ) } ` , {
135+ signer,
136+ upgradeable,
137+ ERC7579Modules : 'AccountERC7579' ,
138+ signatureValidation : 'ERC7739' ,
139+ } ) ;
140+
141+ testAccount ( `${ title } with ERC7579 hooks ${ format ( upgradeable ) } ` , {
142+ signer,
143+ upgradeable,
144+ ERC7579Modules : 'AccountERC7579Hooked' ,
145+ } ) ;
146+ }
121147}
0 commit comments