pr feedback

This commit is contained in:
Hsiao-Wei Wang 2021-10-15 00:30:24 +08:00
parent 3a242a1e0b
commit f62167c4ab
No known key found for this signature in database
GPG Key ID: 1111A8A81778319E
2 changed files with 2 additions and 4 deletions

View File

@ -131,7 +131,7 @@ def test_transition_with_non_empty_activation_queue(state, fork_epoch, spec, pos
"""
transition_until_fork(spec, state, fork_epoch)
_, queuing_indices = set_some_new_deposits(spec, state, rng=random.Random(5566))
queuing_indices = set_some_new_deposits(spec, state, rng=random.Random(5566))
assert spec.get_current_epoch(state) < fork_epoch
assert len(queuing_indices) > 0

View File

@ -7,7 +7,6 @@ from eth2spec.test.helpers.state import next_epoch
def set_some_new_deposits(spec, state, rng):
eligible_indices = []
queuing_indices = []
num_validators = len(state.validators)
# Set ~1/10 to just recently deposited
@ -20,10 +19,9 @@ def set_some_new_deposits(spec, state, rng):
# Set ~half of selected to eligible for activation
if rng.choice([True, False]):
state.validators[index].activation_eligibility_epoch = spec.get_current_epoch(state)
eligible_indices.append(index)
else:
queuing_indices.append(index)
return eligible_indices, queuing_indices
return queuing_indices
def exit_random_validators(spec, state, rng, fraction=None, exit_epoch=None, withdrawable_epoch=None, forward=True):