diff --git a/web3.js/src/publickey.ts b/web3.js/src/publickey.ts index 25ee299e5c..e5ca6f0aa3 100644 --- a/web3.js/src/publickey.ts +++ b/web3.js/src/publickey.ts @@ -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`); } }