Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wait for confirmation function #480

Merged
merged 2 commits into from
Dec 7, 2021
Merged

Conversation

jasonpaulos
Copy link
Member

Fixes the following issue with the wait for confirmation function:

  1. If the call to pendingTransactionInformation throws an error, that error should be ignored and the function should continue retrying if waitRounds allows it.

src/wait.ts Outdated
Comment on lines 38 to 47
if (pendingInfo != null) {
if (pendingInfo['confirmed-round']) {
// Got the completed Transaction
return pendingInfo;
}

if (pendingInfo['pool-error']) {
// If there was a pool error, then the transaction has been rejected!
throw new Error(`Transaction Rejected: ${pendingInfo['pool-error']}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move into the try block.

You check pendingInfo != null but above we check typeof status === 'undefined'. Which of these is more correct? Maybe checking for null isn't needed inside the try block.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points, I'll modify this section

@jasonpaulos jasonpaulos merged commit 9dd99e9 into develop Dec 7, 2021
@jasonpaulos jasonpaulos deleted the fix-wait-for-confirmation branch December 7, 2021 21:03
aldur pushed a commit that referenced this pull request Jan 20, 2022
* Fix wait for confirmation function

* Respond to feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants