aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-09-13 04:38:02 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-14 05:22:30 +0800
commit6fa1cd62258ba96d1a55bee140f2d1f10f091ed2 (patch)
tree422e3a428393a14777f7ca59d670fd1e9dbc828f /ui/app/components
parent8f31b05ac5b7d8383c720b8b0c9f7f3cecc937f5 (diff)
downloadtangerine-wallet-browser-6fa1cd62258ba96d1a55bee140f2d1f10f091ed2.tar.gz
tangerine-wallet-browser-6fa1cd62258ba96d1a55bee140f2d1f10f091ed2.tar.zst
tangerine-wallet-browser-6fa1cd62258ba96d1a55bee140f2d1f10f091ed2.zip
Reapply conversion utility changes and fix calls to utility in pending-tx.
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/pending-tx.js30
1 files changed, 21 insertions, 9 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 6ae0444e7..0bc995afb 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -74,18 +74,24 @@ PendingTx.prototype.getTotal = function () {
const { params = [] } = decodedData || {}
const { name, value } = params[1] || {}
const amountBn = name === '_value'
- ? new BN(value)
- : hexToBn(txParams.value)
-
+ ? value
+ : txParams.value
+
const USD = conversionUtil(amountBn, {
- fromFormat: 'BN',
+ fromNumericBase: 'hex',
+ toNumericBase: 'dec',
+ fromCurrency: 'ETH',
toCurrency: 'USD',
+ numberOfDecimals: 2,
conversionRate,
})
const ETH = conversionUtil(amountBn, {
- fromFormat: 'BN',
+ fromNumericBase: 'hex',
+ toNumericBase: 'dec',
+ fromCurrency: 'ETH',
toCurrency: 'ETH',
conversionRate,
+ numberOfDecimals: 6,
})
return {
@@ -109,15 +115,21 @@ PendingTx.prototype.getGasFee = function () {
const txFeeBn = gasBn.mul(gasPriceBn)
const USD = conversionUtil(txFeeBn, {
- fromFormat: 'BN',
- fromCurrency: 'GWEI',
+ fromNumericBase: 'BN',
+ toNumericBase: 'dec',
+ fromDenomination: 'WEI',
+ fromCurrency: 'ETH',
toCurrency: 'USD',
+ numberOfDecimals: 2,
conversionRate,
})
const ETH = conversionUtil(txFeeBn, {
- fromFormat: 'BN',
- fromCurrency: 'GWEI',
+ fromNumericBase: 'BN',
+ toNumericBase: 'dec',
+ fromDenomination: 'WEI',
+ fromCurrency: 'ETH',
toCurrency: 'ETH',
+ numberOfDecimals: 6,
conversionRate,
})