cleanup set some new deposits helper for rewards tests
This commit is contained in:
parent
97b6db4971
commit
96b5733086
|
@ -64,13 +64,13 @@ def run_attestation_component_deltas(spec, state, component_delta_fn, matching_a
|
||||||
|
|
||||||
def set_some_new_deposits(spec, state, rng):
|
def set_some_new_deposits(spec, state, rng):
|
||||||
num_validators = len(state.validators)
|
num_validators = len(state.validators)
|
||||||
# last 10th of validators are new deposits
|
# Set ~1/10 to just recently deposited
|
||||||
for i in range(len(state.validators))[0:num_validators // 10]:
|
for index in range(num_validators):
|
||||||
index = num_validators - 1 - i
|
if rng.randrange(num_validators) < num_validators // 10:
|
||||||
mock_deposit(spec, state, index)
|
mock_deposit(spec, state, index)
|
||||||
# Set half to eligible for activation
|
# Set ~half of selected to eligible for activation
|
||||||
if i % 2 == 0:
|
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)
|
||||||
|
|
||||||
|
|
||||||
def exit_random_validators(spec, state, rng):
|
def exit_random_validators(spec, state, rng):
|
||||||
|
|
Loading…
Reference in New Issue