From: Chris Duncan Date: Wed, 13 Aug 2025 16:26:19 +0000 (-0700) Subject: Include input on block sign errors, which is stripped in production build. X-Git-Tag: v0.10.5~41^2~109 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=0079c472a64b48ba8f1781544a10a00b141f88d5;p=libnemo.git Include input on block sign errors, which is stripped in production build. --- diff --git a/src/lib/block.ts b/src/lib/block.ts index 12a1da4..eec69f9 100644 --- a/src/lib/block.ts +++ b/src/lib/block.ts @@ -422,7 +422,7 @@ export class Block { const signature = await NanoNaCl.detached(this.#hash(), hex.toBytes(input)) this.signature = bytes.toHex(signature) } else if (typeof input !== 'number' && typeof input !== 'string' && !(input instanceof Wallet)) { - throw new TypeError('Invalid signing input') + throw new TypeError('Invalid signing input', { cause: input }) } else if (input instanceof Wallet && typeof param === 'number') { const wallet = input await wallet.sign(param, this) @@ -440,7 +440,7 @@ export class Block { } await ledger.sign(index, this) } else { - throw new TypeError('Invalid key for block signature', { cause: typeof input }) + throw new TypeError('Invalid key for block signature', { cause: input }) } resolve(this) } catch (err) {