From 6fa1cd62258ba96d1a55bee140f2d1f10f091ed2 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 12 Sep 2017 18:08:02 -0230 Subject: Reapply conversion utility changes and fix calls to utility in pending-tx. --- ui/app/components/pending-tx.js | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'ui/app/components') 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, }) -- cgit