File tree Expand file tree Collapse file tree 6 files changed +8
-14
lines changed Expand file tree Collapse file tree 6 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -338,12 +338,11 @@ export class Wallet {
338
338
// is not "dangerous", aka it does not have any delegate calls
339
339
// or calls to the wallet contract itself
340
340
if ( ! options ?. unsafe ) {
341
- const lowerCaseSelf = this . address . toLowerCase ( )
342
341
for ( const call of calls ) {
343
342
if ( call . delegateCall ) {
344
343
throw new Error ( 'delegate calls are not allowed in safe mode' )
345
344
}
346
- if ( call . to . toLowerCase ( ) === lowerCaseSelf ) {
345
+ if ( Address . isEqual ( call . to , this . address ) ) {
347
346
throw new Error ( 'calls to the wallet contract itself are not allowed in safe mode' )
348
347
}
349
348
}
@@ -452,12 +451,11 @@ export class Wallet {
452
451
// is not "dangerous", aka it does not have any delegate calls
453
452
// or calls to the wallet contract itself
454
453
if ( ! options ?. unsafe ) {
455
- const lowerCaseSelf = this . address . toLowerCase ( )
456
454
for ( const call of calls ) {
457
455
if ( call . delegateCall ) {
458
456
throw new Error ( 'delegate calls are not allowed in safe mode' )
459
457
}
460
- if ( call . to . toLowerCase ( ) === lowerCaseSelf ) {
458
+ if ( Address . isEqual ( call . to , this . address ) ) {
461
459
throw new Error ( 'calls to the wallet contract itself are not allowed in safe mode' )
462
460
}
463
461
}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export class IdentitySigner implements Signers.Signer {
30
30
readonly authKey : AuthKey ,
31
31
) { }
32
32
33
- get address ( ) : `0x${ string } ` {
33
+ get address ( ) : Address . Address {
34
34
if ( ! Address . validate ( this . authKey . identitySigner ) ) {
35
35
throw new Error ( 'No signer address found' )
36
36
}
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export class MnemonicHandler implements Handler {
66
66
return reject ( 'invalid-mnemonic' )
67
67
}
68
68
69
- if ( signer . address . toLowerCase ( ) !== address . toLowerCase ( ) ) {
69
+ if ( ! Address . isEqual ( signer . address , address ) ) {
70
70
return reject ( 'wrong-mnemonic' )
71
71
}
72
72
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export class Recovery {
27
27
transformer : ( leaves : Extensions . Recovery . RecoveryLeaf [ ] ) => Extensions . Recovery . RecoveryLeaf [ ] ,
28
28
) {
29
29
const ext = this . shared . sequence . extensions . recovery
30
- const idx = modules . findIndex ( ( m ) => m . address === ext )
30
+ const idx = modules . findIndex ( ( m ) => Address . isEqual ( m . address , ext ) )
31
31
if ( idx === - 1 ) {
32
32
return
33
33
}
Original file line number Diff line number Diff line change @@ -765,7 +765,7 @@ export class Wallets {
765
765
const nextDevicesTopology = buildCappedTree ( [
766
766
...Config . getSigners ( devicesTopology )
767
767
. signers . filter (
768
- ( x ) => x !== '0x0000000000000000000000000000000000000000' && x . toLowerCase ( ) !== device . address . toLowerCase ( ) ,
768
+ ( x ) => x !== '0x0000000000000000000000000000000000000000' && ! Address . isEqual ( x , device . address ) ,
769
769
)
770
770
. map ( ( x ) => ( { address : x } ) ) ,
771
771
...Config . getSigners ( devicesTopology ) . sapientSigners ,
Original file line number Diff line number Diff line change @@ -220,9 +220,7 @@ describe('Sessions (via Manager)', () => {
220
220
221
221
// Sign and complete the request
222
222
const sigRequest = await wdk . manager . getSignatureRequest ( requestId )
223
- const identitySigner = sigRequest . signers . find (
224
- ( s ) => s . address . toLowerCase ( ) === wdk . identitySignerAddress . toLowerCase ( ) ,
225
- )
223
+ const identitySigner = sigRequest . signers . find ( ( s ) => Address . isEqual ( s . address , wdk . identitySignerAddress ) )
226
224
if ( ! identitySigner || ( identitySigner . status !== 'actionable' && identitySigner . status !== 'ready' ) ) {
227
225
throw new Error ( `Identity signer not found or not ready/actionable: ${ identitySigner ?. status } ` )
228
226
}
@@ -305,9 +303,7 @@ describe('Sessions (via Manager)', () => {
305
303
306
304
// Sign and complete the request
307
305
const sigRequest = await wdk . manager . getSignatureRequest ( requestId )
308
- const identitySigner = sigRequest . signers . find (
309
- ( s ) => s . address . toLowerCase ( ) === wdk . identitySignerAddress . toLowerCase ( ) ,
310
- )
306
+ const identitySigner = sigRequest . signers . find ( ( s ) => Address . isEqual ( s . address , wdk . identitySignerAddress ) )
311
307
if ( ! identitySigner || ( identitySigner . status !== 'actionable' && identitySigner . status !== 'ready' ) ) {
312
308
throw new Error ( `Identity signer not found or not ready/actionable: ${ identitySigner ?. status } ` )
313
309
}
You can’t perform that action at this time.
0 commit comments