Skip to content

Commit

Permalink
Merge pull request #184 from Gearbox-protocol/tests-pool-fix
Browse files Browse the repository at this point in the history
fix: fill pools when not enough liquidity in tests
  • Loading branch information
Van0k authored Feb 25, 2024
2 parents 27d0544 + fd7d00a commit 4f0c61f
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 4f0c61f

Please sign in to comment.