Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
fix: 🐛 signers/injectedTypedEthereumSigner: Fix address/pubKey casing…
Browse files Browse the repository at this point in the history
… to always be lowercase
  • Loading branch information
JesseTheRobot committed Aug 24, 2023
1 parent f0a987b commit 4f55236
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/signing/chains/InjectedTypedEthereumSigner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class InjectedTypedEthereumSigner extends InjectedEthereumSigner
private address: string;

async ready(): Promise<void> {
this.address = await this.signer.getAddress();
this.address = (await this.signer.getAddress()).toLowerCase();
this.publicKey = Buffer.from(this.address); // pk *is* address
}

Expand All @@ -24,8 +24,8 @@ export default class InjectedTypedEthereumSigner extends InjectedEthereumSigner
}

static verify(pk: string | Buffer, message: Uint8Array, signature: Uint8Array): boolean {
const address = pk;
const address = pk.toString();
const addr = verifyTypedData(domain, types, { address, "Transaction hash": message }, signature);
return address === addr;
return address.toLowerCase() === addr.toLowerCase();
}
}

0 comments on commit 4f55236

Please sign in to comment.