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

Stop waiting after transactionBlockTimeout #5294

Merged

Conversation

Muhammad-Altabba
Copy link
Contributor

@Muhammad-Altabba Muhammad-Altabba commented Jul 28, 2022

Implements #5113
Also, refactored the code at waitForTransactionReceipt and a few other enhancements.
And added 3 reusable utility functions at web3-utils: pollTillDefined, rejectIfTimeout and rejectIfConditionAtInterval. Which are useful when dealing with promises that involve polling, rejecting after a timeout, or rejecting if a condition was met when calling repeatably at every time intervals.

Description

Please include a summary of the changes and be sure to follow our Contribution Guidelines.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:cov and my test cases cover all the lines and branches of the added code.
  • I ran npm run build with success.
  • I have tested the built dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.

    (this is a draft code that needs to be finished after, or along with: #5293)
@Muhammad-Altabba Muhammad-Altabba added the 4.x 4.0 related label Jul 28, 2022
@render
Copy link

render bot commented Jul 28, 2022

@Muhammad-Altabba Muhammad-Altabba marked this pull request as draft July 28, 2022 18:11
 + tiny code cleaning
 + and increase `transactionPollingTimeout` to 2000
 + revert CHANGELOG.md white spaces change
@luu-alex
Copy link
Contributor

luu-alex commented Sep 9, 2022

LGTM, just a small comment. overall great work

Copy link
Contributor

@jdevcs jdevcs left a comment

Choose a reason for hiding this comment

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

LGTM, just minor changes suggested.

packages/web3-eth/src/errors.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@jdevcs jdevcs left a comment

Choose a reason for hiding this comment

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

Approved, before merging check that all tests are passing in CI.
Good work.

@Muhammad-Altabba Muhammad-Altabba merged commit 58beddf into 4.x Sep 22, 2022
@Muhammad-Altabba Muhammad-Altabba deleted the feature/5113/stop-waiting-after-transactionBlockTimeout branch September 22, 2022 20:33
@jdevcs jdevcs mentioned this pull request Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants