Skip to content

Commit 22ab594

Browse files
committed
fix: require check and update tests
1 parent 52c1dfb commit 22ab594

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/contracts/core/AllocationManager.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ contract AllocationManager is
183183

184184
(StrategyInfo memory info, Allocation memory allocation) =
185185
_getUpdatedAllocation(operator, operatorSet.key(), strategy);
186-
require(allocation.pendingDiff == 0, ModificationAlreadyPending());
186+
require(allocation.effectBlock == 0, ModificationAlreadyPending());
187187

188188
// 2. Check whether the operator's allocation is slashable. If not, we allow instant
189189
// deallocation.

src/test/unit/AllocationManagerUnit.t.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,7 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe
19771977
// Step 5: Modify allocations again (Should not be called)
19781978
AllocateParams[] memory newAllocateParams = _newAllocateParams(defaultOperatorSet, 1000);
19791979
cheats.prank(defaultOperator);
1980+
cheats.expectRevert(ModificationAlreadyPending.selector);
19801981
allocationManager.modifyAllocations(defaultOperator, newAllocateParams);
19811982

19821983
// Assert that the allocation was modified without reverting
@@ -2047,6 +2048,7 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe
20472048
// Note: this should revert but previously it would not prior to the bugfix
20482049
AllocateParams[] memory newAllocateParams1 = _newAllocateParams(operatorSet1, 400);
20492050
cheats.prank(defaultOperator);
2051+
cheats.expectRevert(ModificationAlreadyPending.selector);
20502052
allocationManager.modifyAllocations(defaultOperator, newAllocateParams1);
20512053

20522054
// Assert that the deallocationQueue is unordered for the 2 deallocations in queue
@@ -2112,6 +2114,7 @@ contract AllocationManagerUnitTests_ModifyAllocations is AllocationManagerUnitTe
21122114
// Note: this should revert but previously it would not prior to the bugfix
21132115
AllocateParams[] memory newAllocateParams1 = _newAllocateParams(operatorSet1, 5000);
21142116
cheats.prank(defaultOperator);
2117+
cheats.expectRevert(ModificationAlreadyPending.selector);
21152118
allocationManager.modifyAllocations(defaultOperator, newAllocateParams1);
21162119

21172120
// Assert that the deallocationQueue is unordered for the 2 deallocations in queue

0 commit comments

Comments
 (0)