Skip to content

Commit

Permalink
fixup example after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Mar 7, 2024
1 parent d7476ba commit 402b7c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/examples/zkapps/voting/run-berkeley.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ let tx = await Mina.transaction(
}
);
await tx.prove();
await (await tx.sign([feePayerKey]).send()).waitOrThrowIfError();
await (await tx.sign([feePayerKey]).send()).wait();

console.log('successfully deployed contracts');

Expand All @@ -132,7 +132,7 @@ tx = await Mina.transaction(
}
);
await tx.prove();
await (await tx.sign([feePayerKey]).send()).waitOrThrowIfError();
await (await tx.sign([feePayerKey]).send()).wait();
console.log('voter registered');

await fetchAllAccounts();
Expand All @@ -154,7 +154,7 @@ tx = await Mina.transaction(
}
);
await tx.prove();
await (await tx.sign([feePayerKey]).send()).waitOrThrowIfError();
await (await tx.sign([feePayerKey]).send()).wait();
console.log('candidate registered');
// we have to wait a few seconds before continuing, otherwise we might not get the actions from the archive, we if continue too fast
await new Promise((resolve) => setTimeout(resolve, 20000));
Expand All @@ -173,7 +173,7 @@ tx = await Mina.transaction(
}
);
await tx.prove();
await (await tx.sign([feePayerKey]).send()).waitOrThrowIfError();
await (await tx.sign([feePayerKey]).send()).wait();
console.log('registrations approved');

await fetchAllAccounts();
Expand All @@ -199,7 +199,7 @@ tx = await Mina.transaction(
}
);
await tx.prove();
await (await tx.sign([feePayerKey]).send()).waitOrThrowIfError();
await (await tx.sign([feePayerKey]).send()).wait();
vote(0n, storage.votesStore, storage.candidatesStore);
console.log('voted for a candidate');
await new Promise((resolve) => setTimeout(resolve, 20000));
Expand All @@ -214,7 +214,7 @@ tx = await Mina.transaction(
}
);
await tx.prove();
await (await tx.sign([feePayerKey]).send()).waitOrThrowIfError();
await (await tx.sign([feePayerKey]).send()).wait();
console.log('votes counted');
await new Promise((resolve) => setTimeout(resolve, 20000));

Expand Down
2 changes: 1 addition & 1 deletion src/lib/mina/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ type PendingTransaction = Pick<
* @example
* ```ts
* try {
* const transaction = await pendingTransaction.waitOrThrowIfError({ maxAttempts: 10, interval: 2000 });
* const transaction = await pendingTransaction.wait({ maxAttempts: 10, interval: 2000 });
* console.log('Transaction included in a block.');
* } catch (error) {
* console.error('Transaction rejected or failed to finalize:', error);
Expand Down

0 comments on commit 402b7c8

Please sign in to comment.