Skip to content

Commit

Permalink
refactor: getoperatorsetcount
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Nov 26, 2024
1 parent fca8750 commit c24a46b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/contracts/core/AllocationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ contract AllocationManager is
*/

/// @inheritdoc IAllocationManager
function getAVSSetCount(
function getOperatorSetCount(
address avs
) external view returns (uint256) {
return _operatorSets[avs].length();
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/core/RewardsCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ contract RewardsCoordinator is
/// @inheritdoc IRewardsCoordinator
function setClaimerFor(address earner, address claimer) external checkCanCall(earner) {
// Require that the earner is an operator or AVS
require(delegationManager.isOperator(earner) || allocationManager.getAVSSetCount(earner) > 0, InvalidEarner());
require(delegationManager.isOperator(earner) || allocationManager.getOperatorSetCount(earner) > 0, InvalidEarner());
_setClaimer(earner, claimer);
}

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IAllocationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ interface IAllocationManager is ISignatureUtils, IAllocationManagerErrors, IAllo
* @notice Returns the number of operator sets for the AVS
* @param avs the AVS to query
*/
function getAVSSetCount(
function getOperatorSetCount(
address avs
) external view returns (uint256);

Expand Down
4 changes: 2 additions & 2 deletions src/test/mocks/AllocationManagerMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract AllocationManagerMock is Test {
receive() external payable {}
fallback() external payable {}

mapping(address avs => uint256) public getAVSSetCount;
mapping(address avs => uint256) public getOperatorSetCount;
mapping(address => mapping(IStrategy => Snapshots.DefaultWadHistory)) internal _maxMagnitudeHistory;

function setMaxMagnitudes(
Expand Down Expand Up @@ -72,6 +72,6 @@ contract AllocationManagerMock is Test {
}

function setAVSSetCount(address avs, uint256 numSets) external {
getAVSSetCount[avs] = numSets;
getOperatorSetCount[avs] = numSets;
}
}
2 changes: 1 addition & 1 deletion src/test/unit/AllocationManagerUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3216,7 +3216,7 @@ contract AllocationManagerUnitTests_createOperatorSets is AllocationManagerUnitT
}
}

assertEq(createSetParams.length, allocationManager.getAVSSetCount(avs), "should be correct number of sets");
assertEq(createSetParams.length, allocationManager.getOperatorSetCount(avs), "should be correct number of sets");
}
}

Expand Down

0 comments on commit c24a46b

Please sign in to comment.