Skip to content

Commit

Permalink
refactor(index.page.tsx): remove unnecessary PublicKey conversion and…
Browse files Browse the repository at this point in the history
… logging statements to simplify code and improve readability
  • Loading branch information
ymekuria committed Sep 23, 2024
1 parent 00fa126 commit f1331dd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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...');
Expand Down

0 comments on commit f1331dd

Please sign in to comment.