Skip to content

Commit

Permalink
refactor(zkappWorkerClient.ts): change methods to be asynchronous fun…
Browse files Browse the repository at this point in the history
…ctions to improve code readability and maintain consistency
  • Loading branch information
ymekuria committed Sep 20, 2024
1 parent 8e2d824 commit b6b157b
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ReturnType<typeof fetchAccount>> {
async fetchAccount(publicKey: PublicKey): Promise<ReturnType<typeof fetchAccount>> {
console.log('publicKey', publicKey);
return this.remoteApi.fetchAccount(publicKey);
}

initZkappInstance(publicKey: PublicKey) {
async initZkappInstance(publicKey: PublicKey) {
return this.remoteApi.initZkappInstance(publicKey.toBase58());
}

Expand All @@ -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();
}

Expand Down

0 comments on commit b6b157b

Please sign in to comment.