apply pr feedback on randrange

This commit is contained in:
Alex Stokes 2021-08-25 15:13:20 -07:00
parent c206a2772a
commit 5b0d2627c3
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69
1 changed files with 1 additions and 1 deletions

View File

@ -159,7 +159,7 @@ def _eligible_for_exit(spec, state, index):
def get_random_voluntary_exits(spec, state, to_be_slashed_indices, rng): def get_random_voluntary_exits(spec, state, to_be_slashed_indices, rng):
num_exits = max(1, rng.randrange(spec.MAX_VOLUNTARY_EXITS)) num_exits = rng.randrange(1, spec.MAX_VOLUNTARY_EXITS)
active_indices = set(spec.get_active_validator_indices(state, spec.get_current_epoch(state)).copy()) active_indices = set(spec.get_active_validator_indices(state, spec.get_current_epoch(state)).copy())
indices = set( indices = set(
index for index in active_indices index for index in active_indices