]> git.codecow.com Git - libnemo.git/commitdiff
Include input on block sign errors, which is stripped in production build.
authorChris Duncan <chris@zoso.dev>
Wed, 13 Aug 2025 16:26:19 +0000 (09:26 -0700)
committerChris Duncan <chris@zoso.dev>
Wed, 13 Aug 2025 16:26:19 +0000 (09:26 -0700)
src/lib/block.ts

index 12a1da41fb10dd113293cef8c4e2786d33b55cf3..eec69f9d90b972834005d1456cfe65e1d93e6723 100644 (file)
@@ -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) {