From fdc4d010b2864fd2b2fe74938ce38a28de88711f Mon Sep 17 00:00:00 2001 From: Shawn <44221603+shaspitz@users.noreply.github.com> Date: Thu, 27 Jun 2024 01:19:43 -0700 Subject: [PATCH] test: testRegisterLSTRestaker --- .../avs/MevCommitAVSTest.sol | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/contracts/test/validator-registry/avs/MevCommitAVSTest.sol b/contracts/test/validator-registry/avs/MevCommitAVSTest.sol index b52fc8b2c..640152ec7 100644 --- a/contracts/test/validator-registry/avs/MevCommitAVSTest.sol +++ b/contracts/test/validator-registry/avs/MevCommitAVSTest.sol @@ -415,16 +415,24 @@ contract MevCommitAVSTest is Test { vm.prank(lstRestaker); mevCommitAVS.registerLSTRestaker(chosenVals); + bytes[] memory chosenVals2 = new bytes[](2); + chosenVals2[0] = bytes("valPubkey1"); + chosenVals2[1] = bytes("valPubkey2"); + vm.expectRevert("LST restaker must have deposited into at least one strategy"); + vm.prank(lstRestaker); + mevCommitAVS.registerLSTRestaker(chosenVals2); - - - // ""LST restaker must choose at least one validator"" - - // isOpted in stuff - - // "LST restaker must have deposited into at least one strategy" + strategyManagerMock.setStakerStrategyListLengthReturnValue(3); + vm.expectEmit(true, true, true, true); + emit LSTRestakerRegistered(chosenVals2[0], 2, lstRestaker); + vm.expectEmit(true, true, true, true); + emit LSTRestakerRegistered(chosenVals2[1], 2, lstRestaker); + vm.prank(lstRestaker); + mevCommitAVS.registerLSTRestaker(chosenVals2); - // TODO: "sender must not be registered LST restaker" + vm.expectRevert("sender must not be registered LST restaker"); + vm.prank(lstRestaker); + mevCommitAVS.registerLSTRestaker(chosenVals2); } function testRequestLSTRestakerDeregistration() public { @@ -439,7 +447,6 @@ contract MevCommitAVSTest is Test { } function testFrozenValidatorsCantDeregister() public { - // TODO: } function testFrozenValidatorDoesntAffectLSTRestakerDeregistration() public {