From f1331dde290ee8bf4a403c408b1e80b3d10d5cad Mon Sep 17 00:00:00 2001 From: ymekuria Date: Mon, 23 Sep 2024 01:01:54 -0700 Subject: [PATCH] refactor(index.page.tsx): remove unnecessary PublicKey conversion and logging statements to simplify code and improve readability --- .../04-zkapp-browser-ui/ui/src/pages/index.page.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx b/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx index e66610214..7c58619a1 100644 --- a/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx +++ b/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx @@ -46,21 +46,17 @@ export default function Home() { const publicKeyBase58: string = (await mina.requestAccounts())[0]; setPublicKeyBase58(publicKeyBase58); - const publicKey = PublicKey.fromBase58(publicKeyBase58); - - console.log(`Using key:${publicKey.toBase58()}`); - setDisplayText(`Using key:${publicKey.toBase58()}`); + console.log(`Using key:${publicKeyBase58}`); + setDisplayText(`Using key:${publicKeyBase58}`); setDisplayText('Checking if fee payer account exists...'); console.log('Checking if fee payer account exists...'); - console.log(`Public key to load: ${publicKeyBase58}`); - const res = await zkappWorkerClient.fetchAccount( publicKeyBase58, ); const accountExists = res.error === null; - console.log('setupResponse', accountExists) + setAccountExists(accountExists); await zkappWorkerClient.loadContract(); @@ -71,8 +67,6 @@ export default function Home() { console.log('zkApp compiled'); setDisplayText('zkApp compiled...'); - const zkappPublicKey = PublicKey.fromBase58(ZKAPP_ADDRESS); - await zkappWorkerClient.initZkappInstance(ZKAPP_ADDRESS); console.log('Getting zkApp state...');