@@ -158,6 +158,10 @@ describe('AccountMultiSignerWeighted', function () {
158
158
await expect ( this . mock . signerWeight ( signer3 ) ) . to . eventually . equal ( 3 ) ; // unchanged
159
159
} ) ;
160
160
161
+ it ( "no-op doesn't emit an event" , async function ( ) {
162
+ await expect ( this . mock . $_setSignerWeights ( [ signer1 ] , [ 1 ] ) ) . to . not . emit ( this . mock , 'ERC7913SignerWeightChanged' ) ;
163
+ } ) ;
164
+
161
165
it ( 'cannot set weight to non-existent signer' , async function ( ) {
162
166
// Reverts when setting weight for non-existent signer
163
167
await expect ( this . mock . $_setSignerWeights ( [ signer4 ] , [ 1 ] ) )
@@ -186,28 +190,28 @@ describe('AccountMultiSignerWeighted', function () {
186
190
} ) ;
187
191
188
192
it ( 'validates threshold is reachable when updating weights' , async function ( ) {
189
- // First, lower the weights so the sum is exactly 6 (just enough for threshold=6 )
190
- await expect ( this . mock . $_setSignerWeights ( [ signer1 , signer2 , signer3 ] , [ 1 , 2 , 3 ] ) )
193
+ // First, lower the weights so the sum is exactly 9 (just enough for threshold=9 )
194
+ await expect ( this . mock . $_setSignerWeights ( [ signer1 , signer2 , signer3 ] , [ 2 , 3 , 4 ] ) )
191
195
. to . emit ( this . mock , 'ERC7913SignerWeightChanged' )
192
- . withArgs ( signer1 , 1 )
196
+ . withArgs ( signer1 , 2 )
193
197
. to . emit ( this . mock , 'ERC7913SignerWeightChanged' )
194
- . withArgs ( signer2 , 2 )
198
+ . withArgs ( signer2 , 3 )
195
199
. to . emit ( this . mock , 'ERC7913SignerWeightChanged' )
196
- . withArgs ( signer3 , 3 ) ;
200
+ . withArgs ( signer3 , 4 ) ;
197
201
198
- // Increase threshold to 6
199
- await expect ( this . mock . $_setThreshold ( 6 ) ) . to . emit ( this . mock , 'ERC7913ThresholdSet' ) . withArgs ( 6 ) ;
202
+ // Increase threshold to 9
203
+ await expect ( this . mock . $_setThreshold ( 9 ) ) . to . emit ( this . mock , 'ERC7913ThresholdSet' ) . withArgs ( 9 ) ;
200
204
201
205
// Now try to lower weights so their sum is less than the threshold
202
- await expect ( this . mock . $_setSignerWeights ( [ signer1 , signer2 , signer3 ] , [ 1 , 1 , 1 ] ) ) . to . be . revertedWithCustomError (
206
+ await expect ( this . mock . $_setSignerWeights ( [ signer1 , signer2 , signer3 ] , [ 2 , 2 , 2 ] ) ) . to . be . revertedWithCustomError (
203
207
this . mock ,
204
208
'MultiSignerERC7913UnreachableThreshold' ,
205
209
) ;
206
210
207
211
// Try to increase threshold to be larger than the total weight
208
- await expect ( this . mock . $_setThreshold ( 7 ) )
212
+ await expect ( this . mock . $_setThreshold ( 10 ) )
209
213
. to . be . revertedWithCustomError ( this . mock , 'MultiSignerERC7913UnreachableThreshold' )
210
- . withArgs ( 6 , 7 ) ;
214
+ . withArgs ( 9 , 10 ) ;
211
215
} ) ;
212
216
213
217
it ( 'reports default weight of 1 for signers without explicit weight' , async function ( ) {
0 commit comments