From e11c5c45d239b7954e60d459ad2475424017aeb5 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 2 Dec 2024 08:02:56 -0800 Subject: [PATCH] Instantiate Pool as part of block for calculating pow. --- src/lib/block.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/block.ts b/src/lib/block.ts index bc50ad3..71a25cd 100644 --- a/src/lib/block.ts +++ b/src/lib/block.ts @@ -4,9 +4,11 @@ import { BURN_ADDRESS, PREAMBLE } from './constants.js' import { Account } from './account.js' import { bytes, dec, hex } from './convert.js' +import { NanoNaCl } from './nano-nacl.js' +import { Pool } from './pool.js' import { Rpc } from './rpc.js' import Tools from './tools.js' -import { NanoNaCl } from './nano-nacl.js' +import { Pow } from './workers.js' /** * Represents a block as defined by the Nano cryptocurrency protocol. The Block @@ -14,6 +16,7 @@ import { NanoNaCl } from './nano-nacl.js' * of three derived classes: SendBlock, ReceiveBlock, ChangeBlock. */ abstract class Block { + #pool: Pool account: Account type: string = 'state' abstract subtype: 'send' | 'receive' | 'change' @@ -35,6 +38,7 @@ abstract class Block { } else { throw new TypeError('Invalid account') } + this.#pool = new Pool(Pow) } /** -- 2.34.1