remove try catch as it doesnt catch the implementation exeption

This commit is contained in:
sendra 2021-04-26 17:51:39 +02:00
parent d36b9fd14c
commit c1c2cffd26

View File

@ -132,57 +132,40 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
// incentives // incentives
if (address(0) != address(incentivesController)) { if (address(0) != address(incentivesController)) {
try incentivesController.getAssetData(reserveData.aTokenAddress) returns ( (
uint256 aEmissionPerSecond, uint256 aIncentivesLastUpdateTimestamp, uint256 aTokenIncentivesIndex) { reserveData.aEmissionPerSecond,
reserveData.aIncentivesLastUpdateTimestamp,
reserveData.aTokenIncentivesIndex
) = incentivesController.getAssetData(reserveData.aTokenAddress);
reserveData.aEmissionPerSecond = aEmissionPerSecond; (
reserveData.aIncentivesLastUpdateTimestamp = aIncentivesLastUpdateTimestamp; reserveData.sEmissionPerSecond,
reserveData.aTokenIncentivesIndex = aTokenIncentivesIndex; reserveData.sIncentivesLastUpdateTimestamp,
} catch Error(string memory) {} catch (bytes memory) {} reserveData.sTokenIncentivesIndex
) = incentivesController.getAssetData(reserveData.stableDebtTokenAddress);
try incentivesController.getAssetData(reserveData.variableDebtTokenAddress) returns ( (
uint256 vEmissionPerSecond, uint256 vIncentivesLastUpdateTimestamp, uint256 vTokenIncentivesIndex) { reserveData.vEmissionPerSecond,
reserveData.vIncentivesLastUpdateTimestamp,
reserveData.vEmissionPerSecond = vEmissionPerSecond; reserveData.vTokenIncentivesIndex
reserveData.vIncentivesLastUpdateTimestamp = vIncentivesLastUpdateTimestamp; ) = incentivesController.getAssetData(reserveData.variableDebtTokenAddress);
reserveData.vTokenIncentivesIndex = vTokenIncentivesIndex;
} catch Error(string memory) {} catch (bytes memory) {}
try incentivesController.getAssetData(reserveData.stableDebtTokenAddress) returns (
uint256 sEmissionPerSecond, uint256 sIncentivesLastUpdateTimestamp, uint256 sTokenIncentivesIndex) {
reserveData.sEmissionPerSecond = sEmissionPerSecond;
reserveData.sIncentivesLastUpdateTimestamp = sIncentivesLastUpdateTimestamp;
reserveData.sTokenIncentivesIndex = sTokenIncentivesIndex;
} catch Error(string memory) {} catch (bytes memory) {}
} }
if (user != address(0)) { if (user != address(0)) {
// incentives // incentives
if (address(0) != address(incentivesController)) { if (address(0) != address(incentivesController)) {
try incentivesController.getUserAssetData( userReservesData[i].aTokenincentivesUserIndex = incentivesController.getUserAssetData(
user, user,
reserveData.aTokenAddress reserveData.aTokenAddress
) returns ( );
uint256 aTokenincentivesUserIndex) { userReservesData[i].vTokenincentivesUserIndex = incentivesController.getUserAssetData(
userReservesData[i].aTokenincentivesUserIndex = aTokenincentivesUserIndex;
} catch Error(string memory) {} catch (bytes memory) {}
try incentivesController.getUserAssetData(
user, user,
reserveData.variableDebtTokenAddress reserveData.variableDebtTokenAddress
) returns ( );
uint256 vTokenincentivesUserIndex) { userReservesData[i].sTokenincentivesUserIndex = incentivesController.getUserAssetData(
userReservesData[i].vTokenincentivesUserIndex = vTokenincentivesUserIndex;
} catch Error(string memory) {} catch (bytes memory) {}
try incentivesController.getUserAssetData(
user, user,
reserveData.stableDebtTokenAddress reserveData.stableDebtTokenAddress
) returns ( );
uint256 sTokenincentivesUserIndex) {
userReservesData[i].sTokenincentivesUserIndex = sTokenincentivesUserIndex;
} catch Error(string memory) {} catch (bytes memory) {}
} }
// user reserve data // user reserve data
userReservesData[i].underlyingAsset = reserveData.underlyingAsset; userReservesData[i].underlyingAsset = reserveData.underlyingAsset;
@ -217,18 +200,11 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
} }
} }
uint256 unclaimedRewards;
if (address(0) != address(incentivesController)) {
try incentivesController.getUserUnclaimedRewards(user) returns (uint256 rewards) {
unclaimedRewards = rewards;
} catch {}
}
return ( return (
reservesData, reservesData,
userReservesData, userReservesData,
oracle.getAssetPrice(MOCK_USD_ADDRESS), oracle.getAssetPrice(MOCK_USD_ADDRESS),
unclaimedRewards incentivesController.getUserUnclaimedRewards(user)
); );
} }
} }