Skip to content

Commit

Permalink
fix disable limit cause unvet
Browse files Browse the repository at this point in the history
  • Loading branch information
skhomuti committed Dec 1, 2023
1 parent 6edac12 commit d17ecbc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/CSModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ contract CSModule is IStakingModule, CSModuleBase {
) return;

if (
no.isTargetLimitActive != isTargetLimitActive ||
(!no.isTargetLimitActive && isTargetLimitActive) ||
targetLimit < no.targetLimit
) {
_unvetKeys(nodeOperatorId);
Expand Down
13 changes: 13 additions & 0 deletions test/CSModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,19 @@ contract CsmUpdateTargetValidatorsLimits is CSMCommon {
assertEq(no.totalVettedValidators, 1);
}

function test_updateTargetValidatorsLimits_NoUnvetKeysWhenLimitDisabled()
public
{
uint256 noId = createNodeOperator(2);
csm.updateTargetValidatorsLimits(noId, true, 1);

csm.vetKeys(noId, 1);

csm.updateTargetValidatorsLimits(noId, false, 1);
NodeOperatorInfo memory no = csm.getNodeOperator(noId);
assertEq(no.totalVettedValidators, 1);
}

function test_updateTargetValidatorsLimits_RevertWhenNoNodeOperator()
public
{
Expand Down

0 comments on commit d17ecbc

Please sign in to comment.