Merge branch 'fix/159' into 'master'

Resolve "Fix the updateInterestRates on flashloan"

Closes #159

See merge request aave-tech/protocol-v2!180
This commit is contained in:
Ernesto Boado 2020-11-26 15:29:27 +00:00
commit 2adbc54475
3 changed files with 9 additions and 4 deletions

View File

@ -525,7 +525,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