aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <flyswatter@users.noreply.github.com>2017-06-28 12:00:08 +0800
committerGitHub <noreply@github.com>2017-06-28 12:00:08 +0800
commitddba2af4152668a5767ce874a4727873c72bac72 (patch)
treece43b1d7d15dcbcb932d0810e49fbfa68ba87705
parent3fde5481ef45cbe731a2486855022afe7c1344fe (diff)
parentca832959c224a184c0ad40f5dd4239ec261b7f6b (diff)
downloadtangerine-wallet-browser-ddba2af4152668a5767ce874a4727873c72bac72.tar.gz
tangerine-wallet-browser-ddba2af4152668a5767ce874a4727873c72bac72.tar.zst
tangerine-wallet-browser-ddba2af4152668a5767ce874a4727873c72bac72.zip
Merge pull request #1509 from MetaMask/i1473-dappDefaultGasPrice
I1473 dapp default gas price
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/scripts/controllers/transactions.js16
2 files changed, 10 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 872db1c1a..0d8a814b9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@
- Seed word confirmation wording is now scarier.
- Fix error for invalid seed words.
- Prevent users from submitting two duplicate transactions by disabling submit.
+- Allow Dapps to specify gas price as hex string.
## 3.7.8 2017-6-12
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 31cf8239a..52251d66e 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -150,13 +150,15 @@ module.exports = class TransactionController extends EventEmitter {
const txParams = txMeta.txParams
// ensure value
txParams.value = txParams.value || '0x0'
- this.query.gasPrice((err, gasPrice) => {
- if (err) return cb(err)
- // set gasPrice
- txParams.gasPrice = gasPrice
- // set gasLimit
- this.txProviderUtils.analyzeGasUsage(txMeta, cb)
- })
+ if (!txParams.gasPrice) {
+ this.query.gasPrice((err, gasPrice) => {
+ if (err) return cb(err)
+ // set gasPrice
+ txParams.gasPrice = gasPrice
+ })
+ }
+ // set gasLimit
+ this.txProviderUtils.analyzeGasUsage(txMeta, cb)
}
getUnapprovedTxList () {