@@ -31,6 +31,9 @@ contract MevCommitAVSTest is Test {
3131 uint256 public lstRestakerDeregPeriodBlocks;
3232 string public metadataUrl;
3333
34+ address public operator = address (0x18A8E44e0E225B10a4Af86CEC6e4c514BB95B342 );
35+ uint256 public operatorPrivateKey = uint256 (0xe0ea92e36ee0c574bc092425926b3bfe817ec9471afbe90b577757ee16f60fd8 );
36+
3437 event OperatorRegistered (address indexed operator );
3538 event OperatorDeregistrationRequested (address indexed operator );
3639 event OperatorDeregistered (address indexed operator );
@@ -95,9 +98,16 @@ contract MevCommitAVSTest is Test {
9598
9699 function testRegisterOperator () public {
97100
98- address operator = address (0x888 );
101+ bytes32 digestHash = avsDirectoryMock.calculateOperatorAVSRegistrationDigestHash ({
102+ operator: operator,
103+ avs: address (mevCommitAVS),
104+ salt: bytes32 ("salt " ),
105+ expiry: block .timestamp + 1 days
106+ });
107+
108+ (uint8 v , bytes32 r , bytes32 s ) = vm.sign (operatorPrivateKey, digestHash);
99109 ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature = ISignatureUtils.SignatureWithSaltAndExpiry ({
100- signature: bytes ( " signature " ),
110+ signature: abi.encodePacked (r, s, v ),
101111 salt: bytes32 ("salt " ),
102112 expiry: block .timestamp + 1 days
103113 });
@@ -133,8 +143,6 @@ contract MevCommitAVSTest is Test {
133143 function testRequestOperatorDeregistration () public {
134144 vm.roll (108 );
135145
136- address operator = address (0x888 );
137-
138146 vm.prank (owner);
139147 mevCommitAVS.pause ();
140148 vm.expectRevert (PausableUpgradeable.EnforcedPause.selector );
@@ -176,8 +184,6 @@ contract MevCommitAVSTest is Test {
176184 function testDeregisterOperator () public {
177185 vm.roll (11 );
178186
179- address operator = address (0x888 );
180-
181187 vm.prank (owner);
182188 mevCommitAVS.pause ();
183189 vm.expectRevert (PausableUpgradeable.EnforcedPause.selector );
@@ -232,7 +238,6 @@ contract MevCommitAVSTest is Test {
232238 function testRegisterValidatorsByPodOwners () public {
233239 vm.roll (55 );
234240
235- address operator = address (0x888 );
236241 address podOwner = address (0x420 );
237242 ISignatureUtils.SignatureWithExpiry memory sig = ISignatureUtils.SignatureWithExpiry ({
238243 signature: bytes ("signature " ),
@@ -332,7 +337,6 @@ contract MevCommitAVSTest is Test {
332337
333338 function testRequestValidatorsDeregistration () public {
334339
335- address operator = address (0x888 );
336340 address podOwner = address (0x420 );
337341
338342 bytes [] memory valPubkeys = new bytes [](2 );
@@ -388,7 +392,6 @@ contract MevCommitAVSTest is Test {
388392
389393 function testDeregisterValidator () public {
390394
391- address operator = address (0x888 );
392395 address podOwner = address (0x420 );
393396 bytes [] memory valPubkeys = new bytes [](1 );
394397 valPubkeys[0 ] = bytes ("valPubkey1 " );
@@ -447,7 +450,6 @@ contract MevCommitAVSTest is Test {
447450
448451 function testRegisterLSTRestaker () public {
449452
450- address operator = address (0x888 );
451453 address lstRestaker = address (0x34443 );
452454 address otherAcct = address (0x777 );
453455 bytes [] memory chosenVals = new bytes [](0 );
@@ -631,7 +633,6 @@ contract MevCommitAVSTest is Test {
631633
632634 vm.roll (403 );
633635
634- address operator = address (0x888 );
635636 bytes [] memory valPubkeys2 = new bytes [](1 );
636637 valPubkeys2[0 ] = bytes ("valPubkey1 " );
637638 vm.prank (operator);
@@ -699,7 +700,6 @@ contract MevCommitAVSTest is Test {
699700 assertTrue (mevCommitAVS.getValidatorRegInfo (valPubkeys[1 ]).freezeHeight.exists);
700701
701702 address lstRestaker = address (0x34443 );
702- address operator = address (0x888 );
703703 ISignatureUtils.SignatureWithExpiry memory sig = ISignatureUtils.SignatureWithExpiry ({
704704 signature: bytes ("signature " ),
705705 expiry: 10
@@ -933,7 +933,6 @@ contract MevCommitAVSTest is Test {
933933 function testValidatorsWithReqDeregisteredOperatorsCannotRegister () public {
934934 testRegisterOperator ();
935935
936- address operator = address (0x888 );
937936 vm.prank (operator);
938937 mevCommitAVS.requestOperatorDeregistration (operator);
939938
@@ -1012,19 +1011,28 @@ contract MevCommitAVSTest is Test {
10121011 assertTrue (mevCommitAVS.isValidatorOptedIn (valPubkeys[0 ]));
10131012 assertTrue (mevCommitAVS.isValidatorOptedIn (valPubkeys[1 ]));
10141013
1015- address operator = address (0x888 );
10161014 vm.prank (operator);
10171015 mevCommitAVS.requestOperatorDeregistration (operator);
10181016
10191017 assertFalse (mevCommitAVS.isValidatorOptedIn (valPubkeys[0 ]));
10201018 assertFalse (mevCommitAVS.isValidatorOptedIn (valPubkeys[1 ]));
10211019
1022- address newOperator = address (0x999 );
1020+ address newOperator = address (0x0c94D2aE152F29Bf68A78dc9747BEa59B6f01418 );
1021+ uint256 newOperatorPrivateKey = uint256 (0x61437e7186d6d418e8c3221a88ce4c4aafba32347414d113ed31c425a99085a6 );
10231022 delegationManagerMock.setIsOperator (newOperator, true );
10241023
1024+ bytes32 digestHash = avsDirectoryMock.calculateOperatorAVSRegistrationDigestHash ({
1025+ operator: newOperator,
1026+ avs: address (mevCommitAVS),
1027+ salt: bytes32 ("salt " ),
1028+ expiry: block .timestamp + 1 days
1029+ });
1030+
1031+ (uint8 v , bytes32 r , bytes32 s ) = vm.sign (newOperatorPrivateKey, digestHash);
1032+
10251033 vm.prank (newOperator);
10261034 ISignatureUtils.SignatureWithSaltAndExpiry memory newOperatorSigWithSalt = ISignatureUtils.SignatureWithSaltAndExpiry ({
1027- signature: bytes ( " signature " ),
1035+ signature: abi.encodePacked (r, s, v ),
10281036 salt: bytes32 ("salt " ),
10291037 expiry: block .timestamp + 1 days
10301038 });
@@ -1046,7 +1054,6 @@ contract MevCommitAVSTest is Test {
10461054 function testDeregisteredOperatorCanStillDeregisterValidators () public {
10471055 testRegisterValidatorsByPodOwners ();
10481056
1049- address operator = address (0x888 );
10501057 vm.prank (operator);
10511058 mevCommitAVS.requestOperatorDeregistration (operator);
10521059 assertTrue (mevCommitAVS.getOperatorRegInfo (operator).exists);
0 commit comments