From: Chris Duncan Date: Mon, 2 Dec 2024 16:02:56 +0000 (-0800) Subject: Instantiate Pool as part of block for calculating pow. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=e11c5c45d239b7954e60d459ad2475424017aeb5;p=libnemo.git Instantiate Pool as part of block for calculating pow. --- 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) } /**