Skip to content

Commit

Permalink
Replace logic for eth swap token in fetchQuotesAndSetQuoteState with …
Browse files Browse the repository at this point in the history
…getSwapsEthToken call (#10624)
  • Loading branch information
danjm authored Mar 10, 2021
1 parent 669ab18 commit 9339278
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions ui/app/ducks/swaps/swaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import {
decimalToHex,
getValueFromWeiHex,
decGWEIToHexWEI,
hexToDecimal,
hexWEIToDecGWEI,
} from '../../helpers/utils/conversions.util';
import { conversionLessThan } from '../../helpers/utils/conversion-util';
Expand All @@ -50,11 +49,11 @@ import {
getSelectedAccount,
getTokenExchangeRates,
getUSDConversionRate,
getSwapsEthToken,
} from '../../selectors';
import {
ERROR_FETCHING_QUOTES,
QUOTES_NOT_AVAILABLE_ERROR,
ETH_SWAPS_TOKEN_OBJECT,
SWAP_FAILED_ERROR,
SWAPS_FETCH_ORDER_CONFLICT,
} from '../../helpers/constants/swaps';
Expand Down Expand Up @@ -396,15 +395,7 @@ export const fetchQuotesAndSetQuoteState = (
const balanceError = getBalanceError(state);
const fetchParamsFromToken =
fetchParams?.metaData?.sourceTokenInfo?.symbol === 'ETH'
? {
...ETH_SWAPS_TOKEN_OBJECT,
string: getValueFromWeiHex({
value: selectedAccount.balance,
numberOfDecimals: 4,
toDenomination: 'ETH',
}),
balance: hexToDecimal(selectedAccount.balance),
}
? getSwapsEthToken(state)
: fetchParams?.metaData?.sourceTokenInfo;
const selectedFromToken = getFromToken(state) || fetchParamsFromToken || {};
const selectedToToken =
Expand Down

0 comments on commit 9339278

Please sign in to comment.