From d45ed96efb9148a2ae3c00e3411475ef2100f15a Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Sat, 12 Sep 2020 04:33:29 +0530 Subject: [PATCH] Minor changes --- contracts/logics/exchangeRate/priceFeed.sol | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contracts/logics/exchangeRate/priceFeed.sol b/contracts/logics/exchangeRate/priceFeed.sol index 861e491..8b132b3 100644 --- a/contracts/logics/exchangeRate/priceFeed.sol +++ b/contracts/logics/exchangeRate/priceFeed.sol @@ -94,7 +94,6 @@ contract Resolver is Basic { public view returns ( - uint ethPriceInUsd, uint[] memory tokensPriceInETH ) { tokensPriceInETH = new uint[](tokens.length); @@ -108,17 +107,12 @@ contract Resolver is Basic { tokensPriceInETH[i] = 10 ** 18; } } - - FeedData memory ethFeedData = chainLinkMapping[ethAddr]; - ChainLinkInterface ethFeed = ChainLinkInterface(ethFeedData.feedAddress); - ethPriceInUsd = convertPrice(uint(ethFeed.latestAnswer()), ethFeedData.multiplier); } function getPrice(address token) public view returns ( - uint ethPriceInUsd, uint tokenPriceInETH ) { if (token != ethAddr) { @@ -129,11 +123,17 @@ contract Resolver is Basic { } else { tokenPriceInETH = 10 ** 18; } + } + function getEthPrice() + public + view + returns ( + uint ethPriceInUsd + ) { FeedData memory ethFeedData = chainLinkMapping[ethAddr]; ChainLinkInterface ethFeed = ChainLinkInterface(ethFeedData.feedAddress); ethPriceInUsd = convertPrice(uint(ethFeed.latestAnswer()), ethFeedData.multiplier); - } }