@@ -1190,7 +1190,7 @@ contract StrategyManagerUnitTests_increaseBurnOrRedistributableShares is Strateg
1190
1190
}
1191
1191
}
1192
1192
1193
- contract StrategyManagerUnitTests_decreaseBurnOrRedistributableShares is StrategyManagerUnitTests {
1193
+ contract StrategyManagerUnitTests_clearBurnOrRedistributableShares is StrategyManagerUnitTests {
1194
1194
function _increaseBurnOrRedistributableShares (IStrategy strategy , uint sharesToAdd ) internal {
1195
1195
cheats.prank (address (delegationManagerMock));
1196
1196
strategyManager.increaseBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId, strategy, sharesToAdd);
@@ -1209,7 +1209,7 @@ contract StrategyManagerUnitTests_decreaseBurnOrRedistributableShares is Strateg
1209
1209
1210
1210
cheats.expectEmit (true , true , true , true , address (strategyManager));
1211
1211
emit BurnOrRedistributableSharesDecreased (defaultOperatorSet, defaultSlashId, strategy, shares);
1212
- strategyManager.decreaseBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
1212
+ strategyManager.clearBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
1213
1213
1214
1214
(IStrategy[] memory escrowStrats , uint [] memory escrowShares ) =
1215
1215
strategyManager.getBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
@@ -1231,7 +1231,7 @@ contract StrategyManagerUnitTests_decreaseBurnOrRedistributableShares is Strateg
1231
1231
1232
1232
cheats.expectEmit (true , true , true , true , address (strategyManager));
1233
1233
emit BurnOrRedistributableSharesDecreased (defaultOperatorSet, defaultSlashId, strategy, shares);
1234
- strategyManager.decreaseBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId, 0 );
1234
+ strategyManager.clearBurnOrRedistributableSharesByStrategy (defaultOperatorSet, defaultSlashId, strategy );
1235
1235
1236
1236
(IStrategy[] memory escrowStrats , uint [] memory escrowShares ) =
1237
1237
strategyManager.getBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
@@ -1260,7 +1260,7 @@ contract StrategyManagerUnitTests_decreaseBurnOrRedistributableShares is Strateg
1260
1260
1261
1261
_increaseBurnOrRedistributableShares (strategies, sharesToAdd);
1262
1262
1263
- strategyManager.decreaseBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
1263
+ strategyManager.clearBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
1264
1264
1265
1265
(IStrategy[] memory escrowStrats , uint [] memory escrowShares ) =
1266
1266
strategyManager.getBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
@@ -1292,11 +1292,13 @@ contract StrategyManagerUnitTests_decreaseBurnOrRedistributableShares is Strateg
1292
1292
_increaseBurnOrRedistributableShares (strategies, sharesToAdd);
1293
1293
1294
1294
// Remove shares in random order
1295
- for (uint i = 0 ; i < strategies.length ; ++ i) {
1296
- // Create a random index to remove shares
1297
- uint index = r.Uint256 (0 , strategies.length - i - 1 );
1295
+ uint [] memory indices = new uint [](3 );
1296
+ indices[0 ] = 1 ; // dummyStrat2
1297
+ indices[1 ] = 0 ; // dummyStrat
1298
+ indices[2 ] = 2 ; // dummyStrat3
1298
1299
1299
- strategyManager.decreaseBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId, index);
1300
+ for (uint i = 0 ; i < strategies.length ; ++ i) {
1301
+ strategyManager.clearBurnOrRedistributableSharesByStrategy (defaultOperatorSet, defaultSlashId, strategies[indices[i]]);
1300
1302
1301
1303
(IStrategy[] memory strats , uint [] memory sharesToBurnOrRedistribute ) =
1302
1304
strategyManager.getBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
@@ -1340,7 +1342,7 @@ contract StrategyManagerUnitTests_decreaseBurnOrRedistributableShares is Strateg
1340
1342
1341
1343
cheats.expectRevert ("SafeERC20: low-level call failed " );
1342
1344
cheats.prank (address (delegationManagerMock));
1343
- strategyManager.decreaseBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
1345
+ strategyManager.clearBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId);
1344
1346
1345
1347
assertEq (
1346
1348
strategyManager.getBurnOrRedistributableShares (defaultOperatorSet, defaultSlashId, strategy),
0 commit comments