Skip to content

Commit

Permalink
refactor(zkappWorker.ts): simplify fetchAccount and initZkappInstance…
Browse files Browse the repository at this point in the history
… functions by directly passing PublicKey object instead of an object with publicKey58 property
  • Loading branch information
ymekuria committed Sep 20, 2024
1 parent 4d175c7 commit 249883b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/zkapps/04-zkapp-browser-ui/ui/src/pages/zkappWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ const api = {
compileContract: async (args: {}) => {
await state.Add!.compile();
},
fetchAccount: async (args: { publicKey58: string }) => {
const publicKey = PublicKey.fromBase58(args.publicKey58);
return await fetchAccount({ publicKey });
fetchAccount: async (publicKey: PublicKey) => {
// console.log('args', args )
// const publicKey = PublicKey.fromBase58(args.publicKey58);
return await fetchAccount(publicKey);
},
initZkappInstance: async (args: { publicKey58: string }) => {
const publicKey = PublicKey.fromBase58(args.publicKey58);
initZkappInstance: async (publicKey: PublicKey) => {
console.log(publicKey)
// const publicKey = PublicKey.fromBase58(args.publicKey58);
state.zkapp = new state.Add!(publicKey);
},
getNum: async (args: {}) => {
Expand Down

0 comments on commit 249883b

Please sign in to comment.