From 0e70275b07ca25ee805fa4e797faf1ba93edd47b Mon Sep 17 00:00:00 2001 From: Ian Macalinao Date: Tue, 29 Nov 2022 01:29:40 -0600 Subject: [PATCH] chore: use constant for PUBLIC_KEY_LENGTH for checking length of input (#27876) --- web3.js/src/publickey.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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`); } }