aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHsuan Lee <boczeratul@gmail.com>2019-04-11 11:03:54 +0800
committerHsuan Lee <boczeratul@gmail.com>2019-04-11 11:03:54 +0800
commitbd0636e81e06c1602bdbf4da123f245af4a0c6f3 (patch)
tree22a653b87afb01e963442fabf769344fef00f753
parentcdb1b8b5dff26b384b421e4dcb7f593eee58b191 (diff)
downloaddexon-wallet-bd0636e81e06c1602bdbf4da123f245af4a0c6f3.tar.gz
dexon-wallet-bd0636e81e06c1602bdbf4da123f245af4a0c6f3.tar.zst
dexon-wallet-bd0636e81e06c1602bdbf4da123f245af4a0c6f3.zip
Change gas estimate when tx may fail
-rw-r--r--ui/app/components/send/send.utils.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/ui/app/components/send/send.utils.js b/ui/app/components/send/send.utils.js
index b2ac41e9..b60c802f 100644
--- a/ui/app/components/send/send.utils.js
+++ b/ui/app/components/send/send.utils.js
@@ -236,13 +236,9 @@ async function estimateGas ({
}
}
- // if not, fall back to block gasLimit
- paramsForGasEstimate.gas = ethUtil.addHexPrefix(multiplyCurrencies(blockGasLimit, 0.95, {
- multiplicandBase: 16,
- multiplierBase: 10,
- roundDown: '0',
- toNumericBase: 'hex',
- }))
+ // if not, fall back to base token cost
+ paramsForGasEstimate.gas = BASE_TOKEN_GAS_COST
+
// run tx
return new Promise((resolve, reject) => {
return estimateGasMethod(paramsForGasEstimate, (err, estimatedGas) => {