aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-08-29 22:50:48 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-08-31 19:16:07 +0800
commite7b3ef0708290a81dad5c469adaa6fab3f1c45b5 (patch)
tree29f471ff840cf3eb97af77de45eb136a703e7aa6 /ui/app/util.js
parent3ea841e27621a8e9972677e46dbd8e3f0c002632 (diff)
downloadtangerine-wallet-browser-e7b3ef0708290a81dad5c469adaa6fab3f1c45b5.tar.gz
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.js11
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)
}