Skip to content

Commit

Permalink
fix vault test
Browse files Browse the repository at this point in the history
  • Loading branch information
elshan-eth committed Dec 20, 2024
1 parent aba293a commit e5dabd5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/vault/test/foundry/BigPoolData.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract BigPoolDataTest is BaseVaultTest {

newPool = address(deployPoolMock(IVault(address(vault)), name, symbol));

_approveForPool(IERC20(newPool));
_approveForNewPool(IERC20(newPool));

factoryMock.registerTestPool(
newPool,
Expand All @@ -75,19 +75,19 @@ contract BigPoolDataTest is BaseVaultTest {
vm.stopPrank();
}

function _approveForSender() internal {
function _approveNewPoolForSender() internal {
for (uint256 i = 0; i < bigPoolTokens.length; ++i) {
bigPoolTokens[i].approve(address(permit2), type(uint256).max);
permit2.approve(address(bigPoolTokens[i]), address(router), type(uint160).max, type(uint48).max);
permit2.approve(address(bigPoolTokens[i]), address(batchRouter), type(uint160).max, type(uint48).max);
}
}

function _approveForPool(IERC20 bpt) internal {
function _approveForNewPool(IERC20 bpt) internal {
for (uint256 i = 0; i < users.length; ++i) {
vm.startPrank(users[i]);

_approveForSender();
_approveNewPoolForSender();

bpt.approve(address(router), type(uint256).max);
bpt.approve(address(batchRouter), type(uint256).max);
Expand Down

0 comments on commit e5dabd5

Please sign in to comment.