diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-13 10:05:00 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-13 14:04:01 +0800 |
commit | b64471833fc925899acb0e9d858624e978eb29af (patch) | |
tree | 80b4cf076049541e38b4801df1947f8b9a5b8c48 /ui/app/components | |
parent | 080890a46ec98814bce8680f561fae3b52d81ed2 (diff) | |
download | tangerine-wallet-browser-b64471833fc925899acb0e9d858624e978eb29af.tar tangerine-wallet-browser-b64471833fc925899acb0e9d858624e978eb29af.tar.gz tangerine-wallet-browser-b64471833fc925899acb0e9d858624e978eb29af.tar.bz2 tangerine-wallet-browser-b64471833fc925899acb0e9d858624e978eb29af.tar.lz tangerine-wallet-browser-b64471833fc925899acb0e9d858624e978eb29af.tar.xz tangerine-wallet-browser-b64471833fc925899acb0e9d858624e978eb29af.tar.zst tangerine-wallet-browser-b64471833fc925899acb0e9d858624e978eb29af.zip |
Revert "Overhaul currency conversion utility and update calls to utility in pending-tx."
This reverts commit 080890a46ec98814bce8680f561fae3b52d81ed2.
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/pending-tx.js | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index a0d59207d..ab425abf5 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -85,6 +85,8 @@ PendingTx.prototype.render = function () { const txFeeBn = gasBn.mul(gasPriceBn) + const amountBn = hexToBn(txParams.value) + // TODO: insufficient balance should be handled on send screen // const maxCost = txFeeBn.add(amountBn) // const balanceBn = hexToBn(balance) @@ -97,39 +99,27 @@ PendingTx.prototype.render = function () { const endOfToAddress = txParams.to.slice(txParams.to.length - 4) const gasFeeInUSD = conversionUtil(txFeeBn, { - fromNumericBase: 'BN', - toNumericBase: 'dec', - fromDenomination: 'WEI', - fromCurrency: 'ETH', + fromFormat: 'BN', + fromCurrency: 'GWEI', toCurrency: 'USD', - numberOfDecimals: 2, conversionRate, }) const gasFeeInETH = conversionUtil(txFeeBn, { - fromNumericBase: 'BN', - toNumericBase: 'dec', - fromDenomination: 'WEI', - fromCurrency: 'ETH', + fromFormat: 'BN', + fromCurrency: 'GWEI', toCurrency: 'ETH', - numberOfDecimals: 6, conversionRate, }) - const totalInUSD = conversionUtil(txParams.value, { - fromNumericBase: 'hex', - toNumericBase: 'dec', - fromCurrency: 'ETH', + const totalInUSD = conversionUtil(amountBn, { + fromFormat: 'BN', toCurrency: 'USD', - numberOfDecimals: 2, conversionRate, }) - const totalInETH = conversionUtil(txParams.value, { - fromNumericBase: 'hex', - toNumericBase: 'dec', - fromCurrency: 'ETH', + const totalInETH = conversionUtil(amountBn, { + fromFormat: 'BN', toCurrency: 'ETH', conversionRate, - numberOfDecimals: 6, }) this.inputs = [] |