Updated flashloan updateInterestRates

This commit is contained in:
The3D 2020-11-23 18:44:13 +01:00
parent 13ce62ebe4
commit 584a567635
3 changed files with 9 additions and 4 deletions

View File

@ -508,7 +508,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
_reserves[vars.currentAsset].updateInterestRates(
vars.currentAsset,
vars.currentATokenAddress,
vars.currentPremium,
vars.currentAmountPlusPremium,
0
);

View File

@ -252,6 +252,8 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => {
await _mockFlashLoanReceiver.setFailExecutionTransfer(false);
const reserveDataBefore = await helpersContract.getReserveData(usdc.address);
const flashloanAmount = await convertToCurrencyDecimals(usdc.address, '500');
await pool.flashLoan(
@ -264,6 +266,9 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => {
'0'
);
const reserveDataAfter = helpersContract.getReserveData(usdc.address);
const reserveData = await helpersContract.getReserveData(usdc.address);
const userData = await helpersContract.getUserReserveData(usdc.address, depositor.address);

View File

@ -1194,7 +1194,7 @@ const calcCompoundedInterest = (
.plus(thirdTerm);
};
const calcExpectedInterestRates = (
export const calcExpectedInterestRates = (
reserveSymbol: string,
marketStableRate: BigNumber,
utilizationRate: BigNumber,
@ -1253,7 +1253,7 @@ const calcExpectedInterestRates = (
return [liquidityRate, stableBorrowRate, variableBorrowRate];
};
const calcExpectedOverallBorrowRate = (
export const calcExpectedOverallBorrowRate = (
totalStableDebt: BigNumber,
totalVariableDebt: BigNumber,
currentVariableBorrowRate: BigNumber,
@ -1274,7 +1274,7 @@ const calcExpectedOverallBorrowRate = (
return overallBorrowRate;
};
const calcExpectedUtilizationRate = (
export const calcExpectedUtilizationRate = (
totalStableDebt: BigNumber,
totalVariableDebt: BigNumber,
totalLiquidity: BigNumber