aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <542863+danfinlay@users.noreply.github.com>2017-10-26 04:53:03 +0800
committerGitHub <noreply@github.com>2017-10-26 04:53:03 +0800
commit2489caddd4f42339a98cf0be767ad9cd003ad40c (patch)
tree28202fc7077fb7c5b36eab661c9733280eb1eb7e /ui
parentbba2980d0ad5ea8681c5b891cc9698085e521064 (diff)
parent4903f3e71a0b2a8b4b0d212b61d6efae78f29f8f (diff)
downloadtangerine-wallet-browser-2489caddd4f42339a98cf0be767ad9cd003ad40c.tar.gz
tangerine-wallet-browser-2489caddd4f42339a98cf0be767ad9cd003ad40c.tar.zst
tangerine-wallet-browser-2489caddd4f42339a98cf0be767ad9cd003ad40c.zip
Merge pull request #2476 from MetaMask/100MweiMinGasPrice
Reduce minimum gas price to 100 MWEI
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/bn-as-decimal-input.js16
-rw-r--r--ui/app/components/pending-tx.js11
2 files changed, 15 insertions, 12 deletions
diff --git a/ui/app/components/bn-as-decimal-input.js b/ui/app/components/bn-as-decimal-input.js
index d84834d06..22e37602e 100644
--- a/ui/app/components/bn-as-decimal-input.js
+++ b/ui/app/components/bn-as-decimal-input.js
@@ -31,6 +31,8 @@ BnAsDecimalInput.prototype.render = function () {
const suffix = props.suffix
const style = props.style
const valueString = value.toString(10)
+ const newMin = min && this.downsize(min.toString(10), scale)
+ const newMax = max && this.downsize(max.toString(10), scale)
const newValue = this.downsize(valueString, scale)
return (
@@ -47,8 +49,8 @@ BnAsDecimalInput.prototype.render = function () {
type: 'number',
step: 'any',
required: true,
- min,
- max,
+ min: newMin,
+ max: newMax,
style: extend({
display: 'block',
textAlign: 'right',
@@ -128,15 +130,17 @@ BnAsDecimalInput.prototype.updateValidity = function (event) {
}
BnAsDecimalInput.prototype.constructWarning = function () {
- const { name, min, max } = this.props
+ const { name, min, max, scale, suffix } = this.props
+ const newMin = min && this.downsize(min.toString(10), scale)
+ const newMax = max && this.downsize(max.toString(10), scale)
let message = name ? name + ' ' : ''
if (min && max) {
- message += `must be greater than or equal to ${min} and less than or equal to ${max}.`
+ message += `must be greater than or equal to ${newMin} ${suffix} and less than or equal to ${newMax} ${suffix}.`
} else if (min) {
- message += `must be greater than or equal to ${min}.`
+ message += `must be greater than or equal to ${newMin} ${suffix}.`
} else if (max) {
- message += `must be less than or equal to ${max}.`
+ message += `must be less than or equal to ${newMax} ${suffix}.`
} else {
message += 'Invalid input.'
}
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index c3350fcc1..5b1b367c6 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -15,10 +15,9 @@ const addressSummary = util.addressSummary
const nameForAddress = require('../../lib/contract-namer')
const BNInput = require('./bn-as-decimal-input')
-const MIN_GAS_PRICE_GWEI_BN = new BN(1)
-const GWEI_FACTOR = new BN(1e9)
-const MIN_GAS_PRICE_BN = MIN_GAS_PRICE_GWEI_BN.mul(GWEI_FACTOR)
-const MIN_GAS_LIMIT_BN = new BN(21000)
+// 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)
@@ -175,7 +174,7 @@ PendingTx.prototype.render = function () {
precision: 0,
scale: 0,
// The hard lower limit for gas.
- min: MIN_GAS_LIMIT_BN.toString(10),
+ min: MIN_GAS_LIMIT_BN,
max: safeGasLimit,
suffix: 'UNITS',
style: {
@@ -200,7 +199,7 @@ PendingTx.prototype.render = function () {
precision: 9,
scale: 9,
suffix: 'GWEI',
- min: MIN_GAS_PRICE_GWEI_BN.toString(10),
+ min: MIN_GAS_PRICE_BN,
style: {
position: 'relative',
top: '5px',