Skip to content

Commit

Permalink
fix: fill pools when not enough liquidity in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Van0k committed Feb 25, 2024
1 parent 1f5ec57 commit fd7d00a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contracts/test/helpers/IntegrationTestHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,11 @@ contract IntegrationTestHelper is TestHelper, BalanceHelper, ConfigManager {
uint256 remainingBorrowable = pool.creditManagerBorrowable(address(creditManager));

if (remainingBorrowable < minDebt) {
console.log("Cant setup credit amount because remaing funds < MIN_DEBT");
revert("Cant setup credit amount because remaing funds < MIN_DEBT");
tokenTestSuite.mint(underlying, INITIAL_LP, 5 * minDebt);
tokenTestSuite.approve(underlying, INITIAL_LP, address(pool));

vm.startPrank(INITIAL_LP);
pool.deposit(5 * minDebt, INITIAL_LP);
}

creditAccountAmount = Math.min(creditAccountAmount, Math.max(remainingBorrowable / 2, minDebt));
Expand Down

0 comments on commit fd7d00a

Please sign in to comment.