WASM: PoW

This commit is contained in:
2023-09-24 21:28:39 +01:00
parent 9f731da5be
commit 6e7a28a42b
19 changed files with 1146 additions and 52 deletions

View File

@ -71,11 +71,13 @@ export class EventPublisher {
}
/**
* Apply POW to every event
* Create a copy of this publisher with PoW
*/
pow(target: number, miner?: PowMiner) {
this.#pow = target;
this.#miner = miner;
const ret = new EventPublisher(this.#signer, this.#pubKey);
ret.#pow = target;
ret.#miner = miner;
return ret;
}
#eb(k: EventKind) {