Skip to content

Commit d210ea6

Browse files
committed
Always validate wallet address
1 parent 284db0b commit d210ea6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/wallet/core/src/signers/session-manager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,13 @@ export class SessionManager implements SapientSigner {
360360
payload: Payload.Parented,
361361
signature: SignatureTypes.SignatureOfSapientSignerLeaf,
362362
): Promise<boolean> {
363+
if (!Address.isEqual(wallet, this.wallet.address)) {
364+
throw new Error('Wallet address mismatch')
365+
}
363366
if (!Payload.isCalls(payload)) {
364367
// Only calls are supported
365368
return false
366369
}
367-
368370
if (!this._provider) {
369371
throw new Error('Provider not set')
370372
}

0 commit comments

Comments
 (0)