Skip to content

Commit

Permalink
Merge pull request #185 from Gearbox-protocol/tests-pool-fix
Browse files Browse the repository at this point in the history
fix: smallfix
  • Loading branch information
Van0k authored Feb 29, 2024
2 parents 4f0c61f + 98aad4d commit d4986bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion contracts/test/helpers/IntegrationTestHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "../../interfaces/IAddressProviderV3.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {ContractsRegister} from "@gearbox-protocol/core-v2/contracts/core/ContractsRegister.sol";
import {AccountFactoryV3} from "../../core/AccountFactoryV3.sol";
import {IACL} from "@gearbox-protocol/core-v2/contracts/interfaces/IACL.sol";

import {IWETH} from "@gearbox-protocol/core-v2/contracts/interfaces/external/IWETH.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
Expand Down Expand Up @@ -339,8 +340,13 @@ contract IntegrationTestHelper is TestHelper, BalanceHelper, ConfigManager {
tokenTestSuite.mint(underlying, INITIAL_LP, 5 * minDebt);
tokenTestSuite.approve(underlying, INITIAL_LP, address(pool));

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

address configurator = IACL(addressProvider.getAddressOrRevert(AP_ACL, NO_VERSION_CONTROL)).owner();
uint256 currentLimit = pool.creditManagerDebtLimit(address(creditManager));
vm.prank(configurator);
pool.setCreditManagerDebtLimit(address(creditManager), currentLimit + 5 * minDebt);
}

creditAccountAmount = Math.min(creditAccountAmount, Math.max(remainingBorrowable / 2, minDebt));
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/interfaces/ICreditConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct BalancerPool {
uint8 status;
}

struct UniswapV2Pair {
struct GenericSwapPair {
Contracts router;
Tokens token0;
Tokens token1;
Expand Down Expand Up @@ -89,7 +89,7 @@ struct CreditManagerV3DeployParams {
// ADAPTER CIONFIGURATION
BalancerPool[] balancerPools;
UniswapV3Pair[] uniswapV3Pairs;
UniswapV2Pair[] uniswapV2Pairs;
GenericSwapPair[] genericSwapPairs;
VelodromeV2Pool[] velodromeV2Pools;
}

Expand Down

0 comments on commit d4986bd

Please sign in to comment.