chore: use constant for PUBLIC_KEY_LENGTH for checking length of input (#27876)

This commit is contained in:
Ian Macalinao 2022-11-29 01:29:40 -06:00 committed by GitHub
parent 61803b914f
commit 0e70275b07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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`);
}
}