From 96842aef8f39385d40c73c63788de5ddf3ee92bb Mon Sep 17 00:00:00 2001 From: ymekuria Date: Thu, 19 Sep 2024 13:09:06 -0700 Subject: [PATCH] refactor(zkappWorkerClient.ts): remove unused code --- .../ui/src/pages/zkappWorkerClient.ts | 33 ++----------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/zkappWorkerClient.ts b/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/zkappWorkerClient.ts index cf869a717..ba347e8f2 100644 --- a/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/zkappWorkerClient.ts +++ b/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/zkappWorkerClient.ts @@ -37,9 +37,7 @@ export default class ZkappWorkerClient { } initZkappInstance(publicKey: PublicKey) { - return this._call('initZkappInstance', { - publicKey58: publicKey.toBase58(), - }); + return this.remoteApi.initZkappInstance(publicKey.toBase58()); } async getNum(): Promise { @@ -54,36 +52,9 @@ export default class ZkappWorkerClient { proveUpdateTransaction() { return this.remoteApi.proveUpdateTransaction(); } - + getTransactionJSON() { return this.remoteApi.getTransactionJSON(); } - - // --------------------------------------------------------------------------------------- - - worker: Worker; - - promises: { - [id: number]: { resolve: (res: any) => void; reject: (err: any) => void }; - }; - - nextId: number; - - - _call(fn: WorkerFunctions, args: any) { - return new Promise((resolve, reject) => { - this.promises[this.nextId] = { resolve, reject }; - - const message: ZkappWorkerRequest = { - id: this.nextId, - fn, - args, - }; - - this.worker.postMessage(message); - - this.nextId++; - }); - } }