Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Fix #1844 rpc call 'getGasPrice' is called even when tx.gasPrice is set to 0. #1845

Merged
merged 2 commits into from
Aug 7, 2018

Conversation

nujabes403
Copy link
Contributor

@nujabes403 nujabes403 commented Aug 5, 2018

Fixed wrongly calling 'getGasPrice' even when tx.gasPrice is set to 0. (#1844 )

@nujabes403 nujabes403 changed the title Fix bug: Call 'getGasPrice' rpc when tx.gasPrice is set to 0 intentionally. Fix issue #1844 Aug 5, 2018
@nujabes403 nujabes403 changed the title Fix issue #1844 Fix #1844 rpc call 'getGasPrice' is called even when tx.gasPrice is set to 0. Aug 5, 2018
@nujabes403
Copy link
Contributor Author

nujabes403 commented Aug 5, 2018

Please check my request @frozeman @nivida :)

@coveralls
Copy link

coveralls commented Aug 5, 2018

Coverage Status

Coverage remained the same at 85.501% when pulling d034858 on nujabes403:1.0 into 589165f on ethereum:1.0.

@@ -561,7 +561,7 @@ Method.prototype.buildCall = function() {
};

// Send the actual transaction
if(isSendTx && _.isObject(payload.params[0]) && !payload.params[0].gasPrice) {
if(isSendTx && _.isObject(payload.params[0]) && payload.params[0].gasPrice === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

better is typeof payload.params[0].gasPrice === 'undefined'

Copy link
Contributor Author

@nujabes403 nujabes403 Aug 6, 2018

Choose a reason for hiding this comment

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

@frozeman I agree. I changed comparison logic through typeof operator. d034858

@nujabes403
Copy link
Contributor Author

nujabes403 commented Aug 7, 2018

Description
Fixed wrongly calling 'getGasPrice' even when tx.gasPrice is set to 0.

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 test with success and extended the tests if necessary.
  • I ran npm run build and tested the resulting file from dist folder in a browser.
  • I have tested my code on the live network.

@nivida Changed PR formatting.

@frozeman frozeman merged commit 73c1e0d into web3:1.0 Aug 7, 2018
nachomazzara pushed a commit to nachomazzara/web3.js that referenced this pull request Jun 4, 2020
…is set to 0. (web3#1845)

* Fix bug: Call 'getGasPrice' rpc when tx.gasPrice is set to 0 intentionally

* Compare whether the value is undefined through 'typeof' operator
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants