diff options
author | HackyMiner <hackyminer@gmail.com> | 2018-10-26 16:26:43 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-10-26 16:26:43 +0800 |
commit | 54a8ade2669cb5f8f046509873bc2a9c25425847 (patch) | |
tree | aaf40ae8168848b89365647bb863d0c967932ef8 /ui/app/ducks | |
parent | eaca9a0e8a6a8e65a4dd099c8f860a9616b7360e (diff) | |
download | tangerine-wallet-browser-54a8ade2669cb5f8f046509873bc2a9c25425847.tar tangerine-wallet-browser-54a8ade2669cb5f8f046509873bc2a9c25425847.tar.gz tangerine-wallet-browser-54a8ade2669cb5f8f046509873bc2a9c25425847.tar.bz2 tangerine-wallet-browser-54a8ade2669cb5f8f046509873bc2a9c25425847.tar.lz tangerine-wallet-browser-54a8ade2669cb5f8f046509873bc2a9c25425847.tar.xz tangerine-wallet-browser-54a8ade2669cb5f8f046509873bc2a9c25425847.tar.zst tangerine-wallet-browser-54a8ade2669cb5f8f046509873bc2a9c25425847.zip |
Add support for RPC endpoints with custom chain IDs (#5134)
Diffstat (limited to 'ui/app/ducks')
-rw-r--r-- | ui/app/ducks/confirm-transaction.duck.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/app/ducks/confirm-transaction.duck.js b/ui/app/ducks/confirm-transaction.duck.js index 328943cd3..275eb1551 100644 --- a/ui/app/ducks/confirm-transaction.duck.js +++ b/ui/app/ducks/confirm-transaction.duck.js @@ -2,6 +2,7 @@ import { conversionRateSelector, currentCurrencySelector, unconfirmedTransactionsHashSelector, + getNativeCurrency, } from '../selectors/confirm-transaction' import { @@ -292,16 +293,17 @@ export function updateTxDataAndCalculate (txData) { const state = getState() const currentCurrency = currentCurrencySelector(state) const conversionRate = conversionRateSelector(state) + const nativeCurrency = getNativeCurrency(state) dispatch(updateTxData(txData)) const { txParams: { value = '0x0', gas: gasLimit = '0x0', gasPrice = '0x0' } = {} } = txData const fiatTransactionAmount = getValueFromWeiHex({ - value, toCurrency: currentCurrency, conversionRate, numberOfDecimals: 2, + value, fromCurrency: nativeCurrency, toCurrency: currentCurrency, conversionRate, numberOfDecimals: 2, }) const ethTransactionAmount = getValueFromWeiHex({ - value, toCurrency: 'ETH', conversionRate, numberOfDecimals: 6, + value, fromCurrency: nativeCurrency, toCurrency: nativeCurrency, conversionRate, numberOfDecimals: 6, }) dispatch(updateTransactionAmounts({ @@ -314,13 +316,15 @@ export function updateTxDataAndCalculate (txData) { const fiatTransactionFee = getTransactionFee({ value: hexTransactionFee, + fromCurrency: nativeCurrency, toCurrency: currentCurrency, numberOfDecimals: 2, conversionRate, }) const ethTransactionFee = getTransactionFee({ value: hexTransactionFee, - toCurrency: 'ETH', + fromCurrency: nativeCurrency, + toCurrency: nativeCurrency, numberOfDecimals: 6, conversionRate, }) |