Skip to content

Commit 099c1b9

Browse files
committed
chore: review nits
1 parent 2b9edb9 commit 099c1b9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

test/e2e/BalancerSwap.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ contract BalancerSwapTest is Helper(true) {
105105
userData: abi.encode(maxAmountsIn, poolFees),
106106
fromInternalBalance: false
107107
});
108+
// poolerAddr declared as separate var to prevent stack too deep errors
108109
address poolerAddr = pooler.addr;
109110
bytes32 poolId = pool.getPoolId();
110111
vm.prank(poolerAddr);

test/libraries/encoders/SwapEncoder.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ library SwapEncoder {
124124
function toSwapStep(State storage state, Swap memory swap) private returns (IVault.BatchSwapStep memory step) {
125125
TokenRegistry.State storage tokenRegistry = state.tokenRegistry.tokenRegistry();
126126
step.poolId = swap.poolId;
127-
step.assetInIndex = TokenRegistry.tokenIndices(tokenRegistry, swap.assetIn);
128-
step.assetOutIndex = TokenRegistry.tokenIndices(tokenRegistry, swap.assetOut);
127+
step.assetInIndex = TokenRegistry.tokenIndex(tokenRegistry, swap.assetIn);
128+
step.assetOutIndex = TokenRegistry.tokenIndex(tokenRegistry, swap.assetOut);
129129
step.amount = swap.amount;
130130
step.userData = swap.userData;
131131
}

test/libraries/encoders/TokenRegistry.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ library TokenRegistry {
105105
return (sellTokenIndex - 1, buyTokenIndex - 1);
106106
}
107107

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

0 commit comments

Comments
 (0)