]> git.codecow.com Git - libnemo.git/commitdiff
Fix block processing JSON.
authorChris Duncan <chris@zoso.dev>
Sat, 9 Aug 2025 06:57:09 +0000 (23:57 -0700)
committerChris Duncan <chris@zoso.dev>
Sat, 9 Aug 2025 06:57:09 +0000 (23:57 -0700)
src/lib/block.ts

index 90d811036528bd34c9500d0ddb0baf87e4c3ac43..5da51428d651e0578664307dc7539bda535e99a8 100644 (file)
@@ -276,11 +276,11 @@ export class Block {
                const data = {
                        "subtype": this.subtype,
                        "json_block": "true",
-                       "block": JSON.stringify(this)
+                       "block": this.toJSON()
                }
                const res = await rpc.call('process', data)
                if (res.hash == null) {
-                       throw new Error('Block could not be processed', res)
+                       throw new Error('Block could not be processed', { cause: res })
                }
                return res.hash
        }