Skip to content

Commit 8d932f0

Browse files
committed
fix: tests
1 parent 014e074 commit 8d932f0

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/test/integration/IntegrationUtils.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ contract IntegrationUtils is IntegrationBase {
113113

114114
/// @dev Choose a random subset of validators (selects AT LEAST ONE)
115115
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}));
117117
}
118118

119119
/// -----------------------------------------------------------------------

src/test/integration/tests/eigenpod/SlashBC_OneBCSF.t.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ contract Integration_SlashBC_OneBCSF is IntegrationChecks {
7373
// 4. slash validators on beacon chain (start/complete checkpoint)
7474
uint40[] memory slashedValidators = _choose(validators);
7575

76-
if (slashedValidators.length >= validators.length) slashedValidators.setLength(validators.length - 1);
77-
7876
slashedGwei = beaconChain.slashValidators(slashedValidators, BeaconChainMock.SlashType.Minor);
7977
beaconChain.advanceEpoch_NoWithdrawNoRewards();
8078

@@ -96,6 +94,7 @@ contract Integration_SlashBC_OneBCSF is IntegrationChecks {
9694
// Start/complete CP
9795
// Ensure that not all validators were slashed so that some rewards can be generated when
9896
// we advance epoch
97+
cheats.assume(slashedValidators.length < validators.length);
9998
beaconChain.advanceEpoch();
10099
staker.startCheckpoint();
101100

0 commit comments

Comments
 (0)