From b6b157b5f064d36144c1838cd2e457b17a8df101 Mon Sep 17 00:00:00 2001 From: ymekuria Date: Fri, 20 Sep 2024 10:30:11 -0700 Subject: [PATCH] refactor(zkappWorkerClient.ts): change methods to be asynchronous functions to improve code readability and maintain consistency --- .../ui/src/pages/zkappWorkerClient.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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 c97c2ab9b..287f4b4bb 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 @@ -20,24 +20,24 @@ export default class ZkappWorkerClient { this.remoteApi = Comlink.wrap(worker); } - setActiveInstanceToDevnet() { + async setActiveInstanceToDevnet() { return this.remoteApi.setActiveInstanceToDevnet(); } - loadContract() { + async loadContract() { return this.remoteApi.loadContract(); } - compileContract() { + async compileContract() { return this.remoteApi.compileContract(); } - fetchAccount(publicKey: PublicKey): Promise> { + async fetchAccount(publicKey: PublicKey): Promise> { console.log('publicKey', publicKey); return this.remoteApi.fetchAccount(publicKey); } - initZkappInstance(publicKey: PublicKey) { + async initZkappInstance(publicKey: PublicKey) { return this.remoteApi.initZkappInstance(publicKey.toBase58()); } @@ -46,15 +46,15 @@ export default class ZkappWorkerClient { return Field.fromJSON(JSON.parse(result as string)); } - createUpdateTransaction() { + async createUpdateTransaction() { return this.remoteApi.createUpdateTransaction(); } - proveUpdateTransaction() { + async proveUpdateTransaction() { return this.remoteApi.proveUpdateTransaction(); } - getTransactionJSON() { + async getTransactionJSON() { return this.remoteApi.getTransactionJSON(); }