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

Re-enable repeated firing of confirmation events #1393

Merged
merged 3 commits into from
Mar 13, 2018
Merged

Re-enable repeated firing of confirmation events #1393

merged 3 commits into from
Mar 13, 2018

Conversation

cgewecke
Copy link
Collaborator

At the moment when a transaction receipt is immediately available after a method call, the confirmation event only fires once. It seems like the subscription logic for this case might have been accidentally disabled while making web3-core-method compatible with Parity's instant-seal. This issue primarily affects testing clients like ganache but possibly also Parity and Geth in dev mode.

Because startWatching is set on a delay here and only if the promise hasn't resolved, the subscription never initiates and repeated firings of the confirmation handler never happen.

This PR tries to re-enable multiple confirmations by

  • removing the promise condition and delay
  • passing the immediately retrieved receipt to checkConfirmation so it can be emitted
  • adding logic to handle the case where the direct call to checkConfirmation required by instant-seal is doubled by a call made by the startWatching method.
  • adding a test for multiple confirmations.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 85.907% when pulling 522d54a on cgewecke:fix/repeat-confirmations into c9ca65d on ethereum:1.0.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 85.907% when pulling 522d54a on cgewecke:fix/repeat-confirmations into c9ca65d on ethereum:1.0.

@coveralls
Copy link

coveralls commented Feb 23, 2018

Coverage Status

Coverage increased (+0.07%) to 85.875% when pulling b5e5099 on cgewecke:fix/repeat-confirmations into 54daf21 on ethereum:1.0.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 85.907% when pulling 522d54a on cgewecke:fix/repeat-confirmations into c9ca65d on ethereum:1.0.

@frozeman
Copy link
Contributor

Thanks for the find!

@frozeman frozeman merged commit 9ece0c9 into web3:1.0 Mar 13, 2018
@cgewecke
Copy link
Collaborator Author

Thanks :)

@cgewecke cgewecke deleted the fix/repeat-confirmations branch March 13, 2018 21:00
nachomazzara pushed a commit to nachomazzara/web3.js that referenced this pull request Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants