Skip to content

Commit

Permalink
fix: add failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Valeri committed Dec 29, 2021
1 parent 2df6caa commit 254a021
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {PercentageMath} from '../libraries/math/PercentageMath.sol';
import {DataTypes} from '../libraries/types/DataTypes.sol';
import {IReserveInterestRateStrategy} from '../../interfaces/IReserveInterestRateStrategy.sol';
import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol';
import {Errors} from '../libraries/helpers/Errors.sol';

/**
* @title DefaultReserveInterestRateStrategy contract
Expand Down
37 changes: 37 additions & 0 deletions test-suites/rate-strategy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,41 @@ makeSuite('InterestRateStrategy', (testEnv: TestEnv) => {
rateStrategyStableTwo.stableRateSlope2
);
});

it('Deploy an interest rate strategy with optimalUtilizationRate out of range', async () => {
const { addressesProvider } = testEnv;

await expect(
deployDefaultReserveInterestRateStrategy([
addressesProvider.address,
utils.parseUnits('1.0', 28),
rateStrategyStableTwo.baseVariableBorrowRate,
rateStrategyStableTwo.variableRateSlope1,
rateStrategyStableTwo.variableRateSlope2,
rateStrategyStableTwo.stableRateSlope1,
rateStrategyStableTwo.stableRateSlope2,
rateStrategyStableTwo.baseStableRateOffset,
rateStrategyStableTwo.stableRateExcessOffset,
rateStrategyStableTwo.optimalStableToTotalDebtRatio,
])
).to.be.reverted;
});

it('Deploy an interest rate strategy with optimalStableToTotalDebtRatio out of range', async () => {
const { addressesProvider } = testEnv;
await expect(
deployDefaultReserveInterestRateStrategy([
addressesProvider.address,
rateStrategyStableTwo.optimalUtilizationRate,
rateStrategyStableTwo.baseVariableBorrowRate,
rateStrategyStableTwo.variableRateSlope1,
rateStrategyStableTwo.variableRateSlope2,
rateStrategyStableTwo.stableRateSlope1,
rateStrategyStableTwo.stableRateSlope2,
rateStrategyStableTwo.baseStableRateOffset,
rateStrategyStableTwo.stableRateExcessOffset,
utils.parseUnits('1.0', 28),
])
).to.be.reverted;
});
});

0 comments on commit 254a021

Please sign in to comment.