ensure at least one proposer slashing

This commit is contained in:
Alex Stokes 2021-08-23 12:15:22 -07:00
parent 7b9d70fcec
commit 58c6f33e85
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ def run_slash_and_exit(spec, state, slash_index, exit_index, valid=True):
def get_random_proposer_slashings(spec, state, rng):
num_slashings = rng.randrange(spec.MAX_PROPOSER_SLASHINGS)
num_slashings = max(1, rng.randrange(spec.MAX_PROPOSER_SLASHINGS))
active_indices = spec.get_active_validator_indices(state, spec.get_current_epoch(state)).copy()
indices = [
index for index in active_indices