Skip to content

Commit

Permalink
feat(index.page.tsx): update fetchAccount calls to use publicKeyBase5…
Browse files Browse the repository at this point in the history
…8 and zkappPublicKeyBase58 properties for better readability and consistency
  • Loading branch information
ymekuria committed Sep 20, 2024
1 parent 524de8c commit a434588
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 @@ -114,9 +114,7 @@ export default function Home() {
for (;;) {
setDisplayText('Checking if fee payer account exists...');
console.log('Checking if fee payer account exists...');
const res = await state.zkappWorkerClient!.fetchAccount({
publicKey: state.publicKey!,
});
const res = await state.zkappWorkerClient!.fetchAccount(state.publicKeyBase58);
const accountExists = res.error == null;
if (accountExists) {
break;
Expand All @@ -137,9 +135,7 @@ export default function Home() {
setDisplayText('Creating a transaction...');
console.log('Creating a transaction...');

await state.zkappWorkerClient!.fetchAccount({
publicKey: state.publicKey!,
});
await state.zkappWorkerClient!.fetchAccount(state.publicKeyBase58);

await state.zkappWorkerClient!.createUpdateTransaction();

Expand Down Expand Up @@ -177,9 +173,7 @@ export default function Home() {
console.log('Getting zkApp state...');
setDisplayText('Getting zkApp state...');

await state.zkappWorkerClient!.fetchAccount({
publicKey: state.zkappPublicKey!,
});
await state.zkappWorkerClient!.fetchAccount(state.zkappPublicKeyBase58!);
const currentNum = await state.zkappWorkerClient!.getNum();
setState({ ...state, currentNum });
console.log(`Current state in zkApp: ${currentNum.toString()}`);
Expand Down

0 comments on commit a434588

Please sign in to comment.