Skip to content

Conversation

@jasonpaulos
Copy link
Contributor

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
Contributor 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.

3 participants