Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit ffb5854

Browse files
authored
Merge pull request #230 from Zilliqa/fix/normalizedpubkey
fix(util): normalized pubkey
2 parents 4507afd + 44fa7e8 commit ffb5854

File tree

1 file changed

+2
-1
lines changed
  • packages/zilliqa-js-crypto/src

1 file changed

+2
-1
lines changed

packages/zilliqa-js-crypto/src/util.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ export const compressPublicKey = (publicKey: string): string => {
131131
* @returns {string}
132132
*/
133133
export const getAddressFromPublicKey = (publicKey: string) => {
134+
const normalized = publicKey.toLowerCase().replace('0x', '');
134135
return toChecksumAddress(
135136
hashjs
136137
.sha256()
137-
.update(publicKey, 'hex')
138+
.update(normalized, 'hex')
138139
.digest('hex')
139140
.slice(24),
140141
);

0 commit comments

Comments
 (0)