Skip to content

Commit

Permalink
feat: rm socket migration (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0aa0 authored Jan 21, 2025
1 parent 92a320f commit 2475ab8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
7 changes: 0 additions & 7 deletions src/SocketRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ contract SocketRegistry is ISocketRegistry {
operatorIdToSocket[_operatorId] = _socket;
}

/// @notice migrates the sockets for a list of operators only callable by the owner of the RegistryCoordinator
function migrateOperatorSockets(bytes32[] memory _operatorIds, string[] memory _sockets) external onlyCoordinatorOwner {
for (uint256 i = 0; i < _operatorIds.length; i++) {
operatorIdToSocket[_operatorIds[i]] = _sockets[i];
}
}

/// @notice gets the stored socket for an operator
function getOperatorSocket(bytes32 _operatorId) external view returns (string memory) {
return operatorIdToSocket[_operatorId];
Expand Down
22 changes: 0 additions & 22 deletions test/unit/SocketRegistryUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,4 @@ contract SocketRegistryUnitTests is MockAVSDeployer {
socketRegistry.setOperatorSocket(defaultOperatorId, "testSocket");
}

function test_migrateOperatorSockets() public {
bytes32[] memory operatorIds = new bytes32[](1);
operatorIds[0] = defaultOperatorId;
string[] memory sockets = new string[](1);
sockets[0] = "testSocket";

vm.startPrank(registryCoordinator.owner());
socketRegistry.migrateOperatorSockets(operatorIds, sockets);
assertEq(socketRegistry.getOperatorSocket(defaultOperatorId), "testSocket");
}

function test_migrateOperatorSockets_revert_notCoordinatorOwner() public {
bytes32[] memory operatorIds = new bytes32[](1);
operatorIds[0] = defaultOperatorId;
string[] memory sockets = new string[](1);
sockets[0] = "testSocket";

vm.startPrank(address(0));
vm.expectRevert("SocketRegistry.onlyCoordinatorOwner: caller is not the owner of the registryCoordinator");
socketRegistry.migrateOperatorSockets(operatorIds, sockets);
}

}

0 comments on commit 2475ab8

Please sign in to comment.