From 6e4ad9982cc241c29a379fddc33e28cb72795b70 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 3 Dec 2024 05:02:54 -0800 Subject: [PATCH] Fix address to public key extraction. --- src/lib/account.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/account.ts b/src/lib/account.ts index a1be067..114662e 100644 --- a/src/lib/account.ts +++ b/src/lib/account.ts @@ -228,12 +228,10 @@ export class Account { } static #addressToKey (v: string): string { - const publicKeyBytes = base32.toBytes(v.substring(-60, -8)) + const publicKeyBytes = base32.toBytes(v.slice(-60, -8)) const checksumBytes = base32.toBytes(v.slice(-8)) const blakeHash = new Blake2b(5).update(publicKeyBytes).digest() blakeHash.reverse() - console.log(`checksumBytes: ${checksumBytes}`) - console.log(`blakeHash: ${blakeHash}`) if (bytes.toHex(checksumBytes) !== bytes.toHex(blakeHash)) { throw new Error('Checksum mismatch in address') } -- 2.34.1