Skip to content

Commit

Permalink
chore: use constant for PUBLIC_KEY_LENGTH for checking length of input (
Browse files Browse the repository at this point in the history
  • Loading branch information
macalinao authored and gnapoli23 committed Dec 16, 2022
1 parent fccf075 commit a763851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web3.js/src/publickey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class PublicKey extends Struct {
this._bn = new BN(value);
}

if (this._bn.byteLength() > 32) {
if (this._bn.byteLength() > PUBLIC_KEY_LENGTH) {
throw new Error(`Invalid public key input`);
}
}
Expand Down

0 comments on commit a763851

Please sign in to comment.