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

Fixes calling toHexString on undefined gasPrice #4903

Merged

Conversation

drub0y
Copy link

@drub0y drub0y commented Mar 29, 2022

Description

Fixes bug where, when handleRevert was enabled and the call was to eth_sendRawTransaction, the logic would blindly call parsedTx.gasPrice.toHexString(). However, for EIP-1559 calls, gasPrice will always be undefined and this code will now throw an internal exception which is caught and then rethrow an error that indicates that the reason couldn't be retrieved.

Fixes #4902

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. N/A
  • I have made corresponding changes to the documentation. N/A
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules. N/A
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • 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 and tested 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.

@drub0y drub0y marked this pull request as ready for review March 30, 2022 00:07
@nikoulai nikoulai added the 1.x 1.0 related issues label Mar 30, 2022
@coveralls
Copy link

coveralls commented Mar 30, 2022

Pull Request Test Coverage Report for Build 2066446704

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 74.49%

Totals Coverage Status
Change from base Build 2029198956: -0.007%
Covered Lines: 3238
Relevant Lines: 4102

💛 - Coveralls

@jdevcs jdevcs added the Review Needed Maintainer(s) need to review label Mar 30, 2022
@jdevcs jdevcs changed the base branch from 1.x to junaid/4903e2ewintestsforundefgaspricepr April 13, 2022 13:46
@jdevcs jdevcs merged commit a149806 into web3:junaid/4903e2ewintestsforundefgaspricepr Apr 13, 2022
jdevcs added a commit that referenced this pull request Apr 13, 2022
* Fixes calling toHexString on undefined gasPrice

Fixes #4902

Co-authored-by: Drew Marsh <drub0y@hotmail.com>
@jdevcs
Copy link
Contributor

jdevcs commented Apr 13, 2022

This PR is merged into 1.x via #4940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Review Needed Maintainer(s) need to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

handleRevert implementation broken when no value is specified for gasPrice on eth_sendRawTransaction
5 participants