pr feedback
This commit is contained in:
parent
3a242a1e0b
commit
f62167c4ab
|
@ -131,7 +131,7 @@ def test_transition_with_non_empty_activation_queue(state, fork_epoch, spec, pos
|
||||||
"""
|
"""
|
||||||
transition_until_fork(spec, state, fork_epoch)
|
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 spec.get_current_epoch(state) < fork_epoch
|
||||||
assert len(queuing_indices) > 0
|
assert len(queuing_indices) > 0
|
||||||
|
|
|
@ -7,7 +7,6 @@ from eth2spec.test.helpers.state import next_epoch
|
||||||
|
|
||||||
|
|
||||||
def set_some_new_deposits(spec, state, rng):
|
def set_some_new_deposits(spec, state, rng):
|
||||||
eligible_indices = []
|
|
||||||
queuing_indices = []
|
queuing_indices = []
|
||||||
num_validators = len(state.validators)
|
num_validators = len(state.validators)
|
||||||
# Set ~1/10 to just recently deposited
|
# 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
|
# Set ~half of selected to eligible for activation
|
||||||
if rng.choice([True, False]):
|
if rng.choice([True, False]):
|
||||||
state.validators[index].activation_eligibility_epoch = spec.get_current_epoch(state)
|
state.validators[index].activation_eligibility_epoch = spec.get_current_epoch(state)
|
||||||
eligible_indices.append(index)
|
|
||||||
else:
|
else:
|
||||||
queuing_indices.append(index)
|
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):
|
def exit_random_validators(spec, state, rng, fraction=None, exit_epoch=None, withdrawable_epoch=None, forward=True):
|
||||||
|
|
Loading…
Reference in New Issue