Skip to content

Commit

Permalink
refactor(zkappWorkerClient.ts): remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ymekuria committed Sep 19, 2024
1 parent 4f14c50 commit 96842ae
Showing 1 changed file with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Field> {
Expand All @@ -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++;
});
}
}

0 comments on commit 96842ae

Please sign in to comment.