diff options
author | Dan <danjm.com@gmail.com> | 2017-08-29 22:50:48 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-08-31 19:16:07 +0800 |
commit | e7b3ef0708290a81dad5c469adaa6fab3f1c45b5 (patch) | |
tree | 29f471ff840cf3eb97af77de45eb136a703e7aa6 /ui/app/util.js | |
parent | 3ea841e27621a8e9972677e46dbd8e3f0c002632 (diff) | |
download | tangerine-wallet-browser-e7b3ef0708290a81dad5c469adaa6fab3f1c45b5.tar tangerine-wallet-browser-e7b3ef0708290a81dad5c469adaa6fab3f1c45b5.tar.gz tangerine-wallet-browser-e7b3ef0708290a81dad5c469adaa6fab3f1c45b5.tar.bz2 tangerine-wallet-browser-e7b3ef0708290a81dad5c469adaa6fab3f1c45b5.tar.lz tangerine-wallet-browser-e7b3ef0708290a81dad5c469adaa6fab3f1c45b5.tar.xz tangerine-wallet-browser-e7b3ef0708290a81dad5c469adaa6fab3f1c45b5.tar.zst tangerine-wallet-browser-e7b3ef0708290a81dad5c469adaa6fab3f1c45b5.zip |
Lint fixes
Diffstat (limited to 'ui/app/util.js')
-rw-r--r-- | ui/app/util.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ui/app/util.js b/ui/app/util.js index a624726e2..bea781466 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -2,6 +2,10 @@ const ethUtil = require('ethereumjs-util') const hexToBn = require('../../app/scripts/lib/hex-to-bn') const vreme = new (require('vreme'))() +const MIN_GAS_PRICE_GWEI_BN = new ethUtil.BN(1) +const GWEI_FACTOR = new ethUtil.BN(1e9) +const MIN_GAS_PRICE_BN = MIN_GAS_PRICE_GWEI_BN.mul(GWEI_FACTOR) + // formatData :: ( date: <Unix Timestamp> ) -> String function formatDate (date) { return vreme.format(new Date(date), 'March 16 2014 14:30') @@ -233,14 +237,9 @@ function bnMultiplyByFraction (targetBN, numerator, denominator) { } function getTxFeeBn (gas, gasPrice = MIN_GAS_PRICE_BN.toString(16), blockGasLimit) { - // Gas Limit const gasBn = hexToBn(gas) - const gasLimit = new ethUtil.BN(parseInt(blockGasLimit)) - const safeGasLimit = bnMultiplyByFraction(gasLimit, 19, 20).toString(10) - - // Gas Price const gasPriceBn = hexToBn(gasPrice) const txFeeBn = gasBn.mul(gasPriceBn) - return txFeeBn.toString(16); + return txFeeBn.toString(16) } |