From 932d1d06097c468a4687a95dbe3fa55c96502771 Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Thu, 10 Oct 2024 13:14:01 -0700 Subject: [PATCH] fix: remove pagination of getStrategiesInOperatorSet --- src/contracts/core/AVSDirectory.sol | 12 ++++-------- src/contracts/interfaces/IAVSDirectory.sol | 6 +----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/contracts/core/AVSDirectory.sol b/src/contracts/core/AVSDirectory.sol index 6befc7d7d..5cc7cd3ae 100644 --- a/src/contracts/core/AVSDirectory.sol +++ b/src/contracts/core/AVSDirectory.sol @@ -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); } } diff --git a/src/contracts/interfaces/IAVSDirectory.sol b/src/contracts/interfaces/IAVSDirectory.sol index cf16cf988..3c6801d34 100644 --- a/src/contracts/interfaces/IAVSDirectory.sol +++ b/src/contracts/interfaces/IAVSDirectory.sol @@ -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); /**