From 2b40f4e970860264578cb86614418f1afc137806 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 15 May 2026 01:07:11 -0700 Subject: [PATCH] Discard unnecessary else keyword. --- src/lib/crypto/bip44.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/lib/crypto/bip44.ts b/src/lib/crypto/bip44.ts index 040bdc6..2b27e0e 100644 --- a/src/lib/crypto/bip44.ts +++ b/src/lib/crypto/bip44.ts @@ -111,18 +111,17 @@ function childKey (curve: Curve, pk: Bytes, I: ArrayBuffer): ExtendedKey { const IR = I.slice(I.byteLength / 2) if (curve === 'ed25519 seed') { return ({ privateKey: IL, chainCode: IR }) - } else { - const ILparsed = parse256(new Uint8Array(IL)) - if (ILparsed >= Point.CURVE().n) { - throw new Error('Invalid child key is greater than the order of the curve') - } - const pkParsed = parse256(pk) - const childKey = (ILparsed + pkParsed) % Point.CURVE().n - if (childKey === 0n) { - throw new Error('Invalid child key is zero') - } - return ({ privateKey: ser256(childKey).buffer, chainCode: IR }) } + const ILparsed = parse256(new Uint8Array(IL)) + if (ILparsed >= Point.CURVE().n) { + throw new Error('Invalid child key is greater than the order of the curve') + } + const pkParsed = parse256(pk) + const childKey = (ILparsed + pkParsed) % Point.CURVE().n + if (childKey === 0n) { + throw new Error('Invalid child key is zero') + } + return ({ privateKey: ser256(childKey).buffer, chainCode: IR }) } function ser32 (integer: number): Bytes { -- 2.47.3