* of three derived classes: SendBlock, ReceiveBlock, ChangeBlock.
*/
abstract class Block {
- #pool: Pool
account: Account
type: string = 'state'
abstract subtype: 'send' | 'receive' | 'change'
} else {
throw new TypeError('Invalid account')
}
- this.#pool = new Pool(Pow)
}
/**
* A successful response sets the `work` property.
*/
async pow (): Promise<void> {
+ const pool = new Pool(Pow)
const data = {
"hash": this.previous
}
- const [{ work }] = await this.#pool.work('converge', [data])
+ const [{ work }] = await pool.work('converge', [data])
this.work = work
+ pool.dismiss()
}
/**