Skip to content

Commit

Permalink
chore: review nits
Browse files Browse the repository at this point in the history
  • Loading branch information
meetmangukiya committed Oct 9, 2024
1 parent 2b9edb9 commit 099c1b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions test/e2e/BalancerSwap.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ contract BalancerSwapTest is Helper(true) {
userData: abi.encode(maxAmountsIn, poolFees),
fromInternalBalance: false
});
// poolerAddr declared as separate var to prevent stack too deep errors
address poolerAddr = pooler.addr;
bytes32 poolId = pool.getPoolId();
vm.prank(poolerAddr);
Expand Down
4 changes: 2 additions & 2 deletions test/libraries/encoders/SwapEncoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ library SwapEncoder {
function toSwapStep(State storage state, Swap memory swap) private returns (IVault.BatchSwapStep memory step) {
TokenRegistry.State storage tokenRegistry = state.tokenRegistry.tokenRegistry();
step.poolId = swap.poolId;
step.assetInIndex = TokenRegistry.tokenIndices(tokenRegistry, swap.assetIn);
step.assetOutIndex = TokenRegistry.tokenIndices(tokenRegistry, swap.assetOut);
step.assetInIndex = TokenRegistry.tokenIndex(tokenRegistry, swap.assetIn);
step.assetOutIndex = TokenRegistry.tokenIndex(tokenRegistry, swap.assetOut);
step.amount = swap.amount;
step.userData = swap.userData;
}
Expand Down
4 changes: 2 additions & 2 deletions test/libraries/encoders/TokenRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ library TokenRegistry {
return (sellTokenIndex - 1, buyTokenIndex - 1);
}

/// @dev Returns the token indices for the specified token
function tokenIndices(State storage state, IERC20 token) internal hydrateArray(state) returns (uint256) {
/// @dev Returns the token index for the specified token
function tokenIndex(State storage state, IERC20 token) internal hydrateArray(state) returns (uint256) {
uint256 index = pushIfNotPresentIndexOf(state, token);
return index - 1;
}
Expand Down

0 comments on commit 099c1b9

Please sign in to comment.