@@ -2336,7 +2336,7 @@ contract RegistryCoordinatorUnitTests_BeforeMigration is RegistryCoordinatorUnit
23362336 cheats.prank (address (registryCoordinator.allocationManager ()));
23372337 cheats.expectRevert ();
23382338 registryCoordinator.registerOperator (
2339- defaultOperator, new uint32 [](0 ), abi.encode (defaultSocket, pubkeyRegistrationParams)
2339+ defaultOperator, address (serviceManager), new uint32 [](0 ), abi.encode (defaultSocket, pubkeyRegistrationParams)
23402340 );
23412341 }
23422342
@@ -2345,7 +2345,7 @@ contract RegistryCoordinatorUnitTests_BeforeMigration is RegistryCoordinatorUnit
23452345 operatorSetIds[0 ] = 0 ;
23462346 cheats.prank (address (registryCoordinator.allocationManager ()));
23472347 cheats.expectRevert ();
2348- registryCoordinator.deregisterOperator (defaultOperator, operatorSetIds);
2348+ registryCoordinator.deregisterOperator (defaultOperator, address (serviceManager), operatorSetIds);
23492349 }
23502350
23512351 function test_CreateTotalDelegatedStakeQuorum () public {
@@ -2577,7 +2577,7 @@ contract RegistryCoordinatorUnitTests_AfterMigration is RegistryCoordinatorUnitT
25772577 abi.encode (ISlashingRegistryCoordinatorTypes.RegistrationType.NORMAL, socket, params);
25782578
25792579 cheats.prank (address (registryCoordinator.allocationManager ()));
2580- registryCoordinator.registerOperator (defaultOperator, operatorSetIds, data);
2580+ registryCoordinator.registerOperator (defaultOperator, address (serviceManager), operatorSetIds, data);
25812581 }
25822582
25832583 function test_registerHook_WithChurn () public {
@@ -2634,7 +2634,7 @@ contract RegistryCoordinatorUnitTests_AfterMigration is RegistryCoordinatorUnitT
26342634
26352635 // Prank as allocation manager and call register hook
26362636 cheats.prank (address (registryCoordinator.allocationManager ()));
2637- registryCoordinator.registerOperator (defaultOperator, operatorSetIds, data);
2637+ registryCoordinator.registerOperator (defaultOperator, address (serviceManager), operatorSetIds, data);
26382638 }
26392639
26402640 function test_updateStakesForQuorum () public {
@@ -2703,7 +2703,7 @@ contract RegistryCoordinatorUnitTests_AfterMigration is RegistryCoordinatorUnitT
27032703 abi.encode (ISlashingRegistryCoordinatorTypes.RegistrationType.NORMAL, socket, params);
27042704
27052705 cheats.startPrank (address (registryCoordinator.allocationManager ()));
2706- registryCoordinator.registerOperator (defaultOperator, operatorSetIds, data);
2706+ registryCoordinator.registerOperator (defaultOperator, address (serviceManager), operatorSetIds, data);
27072707
27082708 // registryCoordinator.deregisterOperator(defaultOperator, operatorSetIds);
27092709
@@ -2748,7 +2748,7 @@ contract RegistryCoordinatorUnitTests_AfterMigration is RegistryCoordinatorUnitT
27482748 abi.encode (ISlashingRegistryCoordinatorTypes.RegistrationType.NORMAL, socket, params);
27492749
27502750 vm.expectRevert ();
2751- registryCoordinator.registerOperator (defaultOperator, operatorSetIds, data);
2751+ registryCoordinator.registerOperator (defaultOperator, address (serviceManager), operatorSetIds, data);
27522752 }
27532753
27542754 function test_deregisterHook_Reverts_WhenNotALM () public {
@@ -2792,10 +2792,68 @@ contract RegistryCoordinatorUnitTests_AfterMigration is RegistryCoordinatorUnitT
27922792 abi.encode (ISlashingRegistryCoordinatorTypes.RegistrationType.NORMAL, socket, params);
27932793
27942794 cheats.prank (address (registryCoordinator.allocationManager ()));
2795- registryCoordinator.registerOperator (defaultOperator, operatorSetIds, data);
2795+ registryCoordinator.registerOperator (defaultOperator, address (serviceManager), operatorSetIds, data);
27962796
27972797 cheats.expectRevert ();
2798- registryCoordinator.deregisterOperator (defaultOperator, operatorSetIds);
2798+ registryCoordinator.deregisterOperator (defaultOperator, address (serviceManager), operatorSetIds);
2799+ }
2800+
2801+ function test_deregisterHook_Reverts_WhenInvalidAVS () public {
2802+ _deployMockEigenLayerAndAVS (0 );
2803+ address invalidAVS = address (0x1 );
2804+
2805+ // Create quorum params
2806+ ISlashingRegistryCoordinatorTypes.OperatorSetParam memory operatorSetParams =
2807+ ISlashingRegistryCoordinatorTypes.OperatorSetParam ({
2808+ maxOperatorCount: 10 ,
2809+ kickBIPsOfOperatorStake: 1000 ,
2810+ kickBIPsOfTotalStake: 100
2811+ });
2812+
2813+ uint96 minimumStake = 100 ;
2814+ IStakeRegistryTypes.StrategyParams[] memory strategyParams =
2815+ new IStakeRegistryTypes.StrategyParams [](1 );
2816+ strategyParams[0 ] =
2817+ IStakeRegistryTypes.StrategyParams ({strategy: IStrategy (address (1 )), multiplier: 10000 });
2818+
2819+ // Create total delegated stake quorum
2820+ cheats.prank (registryCoordinatorOwner);
2821+ registryCoordinator.createTotalDelegatedStakeQuorum (operatorSetParams, 0 , strategyParams);
2822+
2823+ // operator sets should be enabled after creating a new quorum
2824+ assertTrue (registryCoordinator.operatorSetsEnabled (), "operatorSetsEnabled should be true " );
2825+
2826+ // Prank as allocation manager and call register hook
2827+ uint32 [] memory operatorSetIds = new uint32 [](1 );
2828+ operatorSetIds[0 ] = 0 ;
2829+
2830+ string memory socket = "socket " ;
2831+ IBLSApkRegistryTypes.PubkeyRegistrationParams memory params;
2832+ // TODO:
2833+ // params = IBLSApkRegistryTypes.PubkeyRegistrationParams({
2834+ // pubkeyG1: defaultPubKey,
2835+ // pubkeyG2: defaultPubKeyG2,
2836+ // pubkeySignature: defaultPubKeySignature
2837+ // });
2838+
2839+ bytes memory data =
2840+ abi.encode (ISlashingRegistryCoordinatorTypes.RegistrationType.NORMAL, socket, params);
2841+
2842+ // Check revert case when register callback is for wrong AVS
2843+ cheats.prank (address (registryCoordinator.allocationManager ()));
2844+ cheats.expectRevert (ISlashingRegistryCoordinatorErrors.InvalidAVS.selector );
2845+ registryCoordinator.registerOperator (defaultOperator, invalidAVS, operatorSetIds, data);
2846+
2847+ cheats.prank (address (registryCoordinator.allocationManager ()));
2848+ registryCoordinator.registerOperator (defaultOperator, address (serviceManager), operatorSetIds, data);
2849+
2850+ // Check revert case when deregistering for wrong AVS
2851+ cheats.prank (address (registryCoordinator.allocationManager ()));
2852+ cheats.expectRevert (ISlashingRegistryCoordinatorErrors.InvalidAVS.selector );
2853+ registryCoordinator.deregisterOperator (defaultOperator, invalidAVS, operatorSetIds);
2854+
2855+ cheats.prank (address (registryCoordinator.allocationManager ()));
2856+ registryCoordinator.deregisterOperator (defaultOperator, address (serviceManager), operatorSetIds);
27992857 }
28002858
28012859 function test_DeregisterHook_Reverts_WhenM2Quorum () public {
0 commit comments