aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHsuan Lee <boczeratul@gmail.com>2019-05-08 00:33:11 +0800
committerHsuan Lee <boczeratul@gmail.com>2019-05-08 00:33:11 +0800
commit4668d419842e2f7c0c1af36447ba1c3716babadf (patch)
tree303c86f862b40955ca7118d871a26882d54acd84
parentb709322da8ef794c74683b413ccfe34fd267d347 (diff)
downloaddexon-wallet-4668d419842e2f7c0c1af36447ba1c3716babadf.tar.gz
dexon-wallet-4668d419842e2f7c0c1af36447ba1c3716babadf.tar.zst
dexon-wallet-4668d419842e2f7c0c1af36447ba1c3716babadf.zip
Fix gas estimation
-rw-r--r--app/scripts/controllers/transactions/tx-gas-utils.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/scripts/controllers/transactions/tx-gas-utils.js b/app/scripts/controllers/transactions/tx-gas-utils.js
index b296dc5e..4a037d30 100644
--- a/app/scripts/controllers/transactions/tx-gas-utils.js
+++ b/app/scripts/controllers/transactions/tx-gas-utils.js
@@ -6,6 +6,7 @@ const {
} = require('../../lib/util')
const { addHexPrefix } = require('ethereumjs-util')
const SIMPLE_GAS_COST = '0x5208' // Hex for 21000, cost of a simple send.
+const BASE_TOKEN_GAS_COST = '0x186a0' // Hex for 100000
import { TRANSACTION_NO_CONTRACT_ERROR_KEY } from '../../../../ui/app/constants/error-keys'
@@ -94,10 +95,8 @@ class TxGasUtil {
}
}
- // fallback to block gasLimit
- const blockGasLimitBN = hexToBn(blockGasLimitHex)
- const saferGasLimitBN = BnMultiplyByFraction(blockGasLimitBN, 19, 20)
- txParams.gas = bnToHex(saferGasLimitBN)
+ // fallback to safe limit
+ txParams.gas = BASE_TOKEN_GAS_COST
// estimate tx gas requirements
return await this.query.estimateGas(txParams)