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

Allow zero gasPrice on testnet. #4037

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fetch token prices based on contract address, not symbol
- Fix bug that prevents setting language locale in settings.
- Show checksum addresses throughout the UI
- Allow zero gas price on testnet.

## 4.5.5 Fri Apr 06 2018

Expand Down
12 changes: 6 additions & 6 deletions old-ui/app/components/pending-tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ const addressSummary = util.addressSummary
const nameForAddress = require('../../lib/contract-namer')
const BNInput = require('./bn-as-decimal-input')

// corresponds with 0.1 GWEI
const MIN_GAS_PRICE_BN = new BN('100000000')
const MIN_GAS_LIMIT_BN = new BN('21000')

module.exports = PendingTx
inherits(PendingTx, Component)
function PendingTx () {
Expand All @@ -29,6 +25,10 @@ function PendingTx () {
txData: null,
submitting: false,
}

// corresponds with 0.1 GWEI on mainnet
this.MIN_GAS_PRICE_BN = this.props.provider === 'mainnet' ? new BN('100000000') : new BN('0')
this.MIN_GAS_LIMIT_BN = new BN('21000')
}

PendingTx.prototype.render = function () {
Expand Down Expand Up @@ -68,7 +68,7 @@ PendingTx.prototype.render = function () {
const safeGasLimit = safeGasLimitBN.toString(10)

// Gas Price
const gasPrice = txParams.gasPrice || MIN_GAS_PRICE_BN.toString(16)
const gasPrice = txParams.gasPrice || this.MIN_GAS_PRICE_BN.toString(16)
const gasPriceBn = hexToBn(gasPrice)

const txFeeBn = gasBn.mul(gasPriceBn)
Expand Down Expand Up @@ -211,7 +211,7 @@ PendingTx.prototype.render = function () {
precision: 9,
scale: 9,
suffix: 'GWEI',
min: forceGasMin || MIN_GAS_PRICE_BN,
min: forceGasMin || this.MIN_GAS_PRICE_BN,
style: {
position: 'relative',
top: '5px',
Expand Down