File tree 2 files changed +2
-3
lines changed
2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ contract IntegrationUtils is IntegrationBase {
113
113
114
114
/// @dev Choose a random subset of validators (selects AT LEAST ONE)
115
115
function _choose (uint40 [] memory validators ) internal returns (uint40 [] memory ) {
116
- return validators.setLength (_randUint ({min: 1 , max: validators.length }));
116
+ return validators.setLength (_randUint ({min: 1 , max: validators.length > 1 ? validators. length - 1 : 1 }));
117
117
}
118
118
119
119
/// -----------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -73,8 +73,6 @@ contract Integration_SlashBC_OneBCSF is IntegrationChecks {
73
73
// 4. slash validators on beacon chain (start/complete checkpoint)
74
74
uint40 [] memory slashedValidators = _choose (validators);
75
75
76
- if (slashedValidators.length >= validators.length ) slashedValidators.setLength (validators.length - 1 );
77
-
78
76
slashedGwei = beaconChain.slashValidators (slashedValidators, BeaconChainMock.SlashType.Minor);
79
77
beaconChain.advanceEpoch_NoWithdrawNoRewards ();
80
78
@@ -96,6 +94,7 @@ contract Integration_SlashBC_OneBCSF is IntegrationChecks {
96
94
// Start/complete CP
97
95
// Ensure that not all validators were slashed so that some rewards can be generated when
98
96
// we advance epoch
97
+ cheats.assume (slashedValidators.length < validators.length );
99
98
beaconChain.advanceEpoch ();
100
99
staker.startCheckpoint ();
101
100
You can’t perform that action at this time.
0 commit comments