aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-02-16 23:57:31 +0800
committerGitHub <noreply@github.com>2018-02-16 23:57:31 +0800
commitb046378e335f23b7c2447c2ad40fe4d8ab2da67a (patch)
treee5918655060dd273e5d7cbea86e4425ae7d2d4a9
parenta26add6fdfbaa74f1d357e42aa9a260b68d14bed (diff)
parent8e80081966e6411fae41f398e063ac0a62fe415c (diff)
downloadtangerine-wallet-browser-b046378e335f23b7c2447c2ad40fe4d8ab2da67a.tar.gz
tangerine-wallet-browser-b046378e335f23b7c2447c2ad40fe4d8ab2da67a.tar.zst
tangerine-wallet-browser-b046378e335f23b7c2447c2ad40fe4d8ab2da67a.zip
Merge pull request #3267 from MetaMask/i3266-IgnoreZeroGasLimit
Default validated block gas limit to 8MM when none identified
-rw-r--r--app/scripts/lib/nonce-tracker.js2
-rw-r--r--ui/app/components/pending-tx.js3
2 files changed, 3 insertions, 2 deletions
diff --git a/app/scripts/lib/nonce-tracker.js b/app/scripts/lib/nonce-tracker.js
index 0029ac953..ed9dd3f11 100644
--- a/app/scripts/lib/nonce-tracker.js
+++ b/app/scripts/lib/nonce-tracker.js
@@ -56,7 +56,7 @@ class NonceTracker {
const blockTracker = this._getBlockTracker()
const currentBlock = blockTracker.getCurrentBlock()
if (currentBlock) return currentBlock
- return await Promise((reject, resolve) => {
+ return await new Promise((reject, resolve) => {
blockTracker.once('latest', resolve)
})
}
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 32d54902e..98193ea6f 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -60,7 +60,8 @@ PendingTx.prototype.render = function () {
// Gas
const gas = txParams.gas
const gasBn = hexToBn(gas)
- const gasLimit = new BN(parseInt(blockGasLimit))
+ // default to 8MM gas limit
+ const gasLimit = new BN(parseInt(blockGasLimit) || '8000000')
const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20)
const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20)
const safeGasLimit = safeGasLimitBN.toString(10)