From 1c297ea3a12441f0252c5c519fea234d38cd6310 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 5 Aug 2025 21:06:00 -0700 Subject: [PATCH] Return block from pow to enable call chain. --- src/lib/block.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/block.ts b/src/lib/block.ts index e4e8a6d..5148f5a 100644 --- a/src/lib/block.ts +++ b/src/lib/block.ts @@ -133,7 +133,7 @@ abstract class Block { * * A successful response sets the `work` property. */ - async pow (): Promise { + async pow (): Promise { const difficulty: bigint = (this instanceof SendBlock || this instanceof ChangeBlock) ? DIFFICULTY_SEND : DIFFICULTY_RECEIVE @@ -149,6 +149,7 @@ abstract class Block { throw new Error('Wwork generated is invalid', { cause: `${check.difficulty} < ${difficulty}` }) } this.work = result.work + return this } /** -- 2.47.3