Skip to content

Commit

Permalink
fix: remove pagination of getStrategiesInOperatorSet
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenli86 committed Oct 10, 2024
1 parent 8f8daab commit 932d1d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
12 changes: 4 additions & 8 deletions src/contracts/core/AVSDirectory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -529,20 +529,16 @@ contract AVSDirectory is
/**
* @notice Returns an array of strategies in the operatorSet.
* @param operatorSet The operatorSet to query.
* @param start The starting index of the array to query.
* @param length The amount of items of the array to return.
*/
function getStrategiesInOperatorSet(
OperatorSet memory operatorSet,
uint256 start,
uint256 length
OperatorSet memory operatorSet
) external view returns (address[] memory strategies) {
bytes32 encodedOperatorSet = _encodeOperatorSet(operatorSet);
uint256 maxLength = _operatorSetStrategies[encodedOperatorSet].length() - start;
if (length > maxLength) length = maxLength;
length = _operatorSetStrategies[encodedOperatorSet].length();

strategies = new address[](length);
for (uint256 i; i < length; ++i) {
strategies[i] = _operatorSetStrategies[encodedOperatorSet].at(start + i);
strategies[i] = _operatorSetStrategies[encodedOperatorSet].at(i);
}
}

Expand Down
6 changes: 1 addition & 5 deletions src/contracts/interfaces/IAVSDirectory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,9 @@ interface IAVSDirectory is IAVSDirectoryEvents, IAVSDirectoryErrors, ISignatureU
/**
* @notice Returns an array of strategies in the operatorSet.
* @param operatorSet The operatorSet to query.
* @param start The starting index of the array to query.
* @param length The amount of items of the array to return.
*/
function getStrategiesInOperatorSet(
OperatorSet memory operatorSet,
uint256 start,
uint256 length
OperatorSet memory operatorSet
) external view returns (address[] memory strategies);

/**
Expand Down

0 comments on commit 932d1d0

Please sign in to comment.