Skip to content

Commit

Permalink
Updated flashloan updateInterestRates
Browse files Browse the repository at this point in the history
  • Loading branch information
The3D committed Nov 23, 2020
1 parent 13ce62e commit 584a567
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/protocol/lendingpool/LendingPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
_reserves[vars.currentAsset].updateInterestRates(
vars.currentAsset,
vars.currentATokenAddress,
vars.currentPremium,
vars.currentAmountPlusPremium,
0
);

Expand Down
5 changes: 5 additions & 0 deletions test/flashloan.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions test/helpers/utils/calculations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ const calcCompoundedInterest = (
.plus(thirdTerm);
};

const calcExpectedInterestRates = (
export const calcExpectedInterestRates = (
reserveSymbol: string,
marketStableRate: BigNumber,
utilizationRate: BigNumber,
Expand Down Expand Up @@ -1253,7 +1253,7 @@ const calcExpectedInterestRates = (
return [liquidityRate, stableBorrowRate, variableBorrowRate];
};

const calcExpectedOverallBorrowRate = (
export const calcExpectedOverallBorrowRate = (
totalStableDebt: BigNumber,
totalVariableDebt: BigNumber,
currentVariableBorrowRate: BigNumber,
Expand All @@ -1274,7 +1274,7 @@ const calcExpectedOverallBorrowRate = (
return overallBorrowRate;
};

const calcExpectedUtilizationRate = (
export const calcExpectedUtilizationRate = (
totalStableDebt: BigNumber,
totalVariableDebt: BigNumber,
totalLiquidity: BigNumber
Expand Down

0 comments on commit 584a567

Please sign in to comment.