fix test generators for mainnet max slashing penalties
This commit is contained in:
parent
29b5efd63e
commit
2e09c91e39
|
@ -26,7 +26,12 @@ def slash_validators(spec, state, indices, out_epochs):
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
def test_max_penalties(spec, state):
|
def test_max_penalties(spec, state):
|
||||||
slashed_count = (len(state.validators) // spec.PROPORTIONAL_SLASHING_MULTIPLIER) + 1
|
# Slashed count to ensure that enough validators are slashed to induce maximum penalties
|
||||||
|
slashed_count = min(
|
||||||
|
(len(state.validators) // spec.PROPORTIONAL_SLASHING_MULTIPLIER) + 1,
|
||||||
|
# Can't slash more than validator count!
|
||||||
|
len(state.validators)
|
||||||
|
)
|
||||||
out_epoch = spec.get_current_epoch(state) + (spec.EPOCHS_PER_SLASHINGS_VECTOR // 2)
|
out_epoch = spec.get_current_epoch(state) + (spec.EPOCHS_PER_SLASHINGS_VECTOR // 2)
|
||||||
|
|
||||||
slashed_indices = list(range(slashed_count))
|
slashed_indices = list(range(slashed_count))
|
||||||
|
|
Loading…
Reference in New Issue