FAIL tests/account.test.js (5.628 s)
● Account › isValidPair(signingKey, accountNumber)
bad seed size
2315 | key: "fromSigningKey",
2316 | value: function fromSigningKey(signingKey) {
> 2317 | var _tweetnacl$sign$keyPa = tweetnacl.sign.keyPair.fromSeed(hexToUint8Array(signingKey)),
| ^
2318 | accountNumber = _tweetnacl$sign$keyPa.publicKey,
2319 | signingKey_ = _tweetnacl$sign$keyPa.secretKey;
2320 |
at Function.fromSeed (node_modules/tweetnacl/nacl-fast.js:2329:11)
at Function.fromSigningKey (dist/index.js:2317:58)
at new Account (dist/index.js:2228:29)
at Function.isValidPair (dist/index.js:2350:14)
at Object.<anonymous> (tests/account.test.js:47:20)
Expected behaviorAccount.isValidPair should just return whether the pair is valid or not, no matter whether the strings are the wrong size or don't include valid hex characters. It should not be throwing any errors at all.
Describe the bug
Account.isValidPair
static method is throwing errors on invalid keys (i.e. bad length, invalid hex chars).To Reproduce Steps to reproduce the behavior:
tests/account.test.js
npm test
The following error happens:
Expected behavior
Account.isValidPair
should just return whether the pair is valid or not, no matter whether the strings are the wrong size or don't include valid hex characters. It should not be throwing any errors at all.