Skip to content

Commit

Permalink
fix: Remove impossible cases. Reasoning added to notion notes
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Aug 26, 2021
1 parent 3163bea commit 2e733be
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
4 changes: 0 additions & 4 deletions test-suites/atoken-edge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ makeSuite('Atoken-logic: edge cases', (testEnv: TestEnv) => {
expect(await aDai.allowance(users[0].address, users[1].address)).to.be.eq(MAX_UINT_AMOUNT);
});

it('approve() owner == address(0)', async () => {
expect(false, 'IMPOSSIBLE').to.be.eq(true);
});

it('approve() spender == address(0)', async () => {
const { users, aDai } = testEnv;
await expect(
Expand Down
12 changes: 1 addition & 11 deletions test-suites/pool-edge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,6 @@ makeSuite('Pool - edge cases', (testEnv: TestEnv) => {
).to.be.revertedWith(RL_RESERVE_ALREADY_INITIALIZED);
});

it('GenericLogic calculateUserAccountData, currentReserveAddress ==address(0)', async () => {
/**
* Unsure how we can get to a state where this is testable.
* We need to add a reserve with address(0), but we cannot add a reserve with address(0),
* because we are checking for that when we init a reserve.
* We can make a drop of the reserve, to get address(0), but this can only be done when
* there is no deposit and borrows. And without those, the `isUsingAsCollateralOrBorrowing` will make us ship the case
*/
expect(false, 'IMPOSSIBLE').to.be.eq(true);
});

it('_addReserveToList() already added', async () => {
/**
* To get into this case, we need to init a reserve with `aTokenAddress = address(0)` twice.
Expand Down Expand Up @@ -196,6 +185,7 @@ makeSuite('Pool - edge cases', (testEnv: TestEnv) => {
});

it('_addReserveToList() reservesCount > _maxNumberOfReserves', async () => {
// TODO: For the love of god, let is make something more nice here.
// Really a pain, but practically, we just want to loop until we hit something high?
const { pool, dai, deployer, configurator } = testEnv;

Expand Down
10 changes: 0 additions & 10 deletions test-suites/validation-logic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ makeSuite('Validation-logic: reverting edge cases', (testEnv: TestEnv) => {
).to.be.revertedWith(VL_RESERVE_FROZEN);
});

it('validateWithdraw() isActive == false', async () => {
/**
* Unclear how we should ever enter this stage. Only possible to get to `isActive == false` if
* `availableLiquidity == 0 && reserveData.currentLiquidityRate == 0`, but this require that there are no funds.
* And if there is no funds, we are stopped earlier in the validation.
*/

expect(false, 'Impossible to reach').to.be.eq(true);
});

it('validateBorrow() vars.isActive == false', async () => {
/**
* Unclear how we should enter this stage with normal usage.
Expand Down

0 comments on commit 2e733be

Please sign in to comment.