fix validator state during deposit randomization

This commit is contained in:
Alex Stokes 2021-08-18 15:43:33 -06:00
parent 3a9dcbadf0
commit 7f70a7704b
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69
1 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
from random import Random
from eth2spec.test.context import is_post_altair
from eth2spec.test.helpers.keys import pubkeys, privkeys
from eth2spec.utils import bls
from eth2spec.utils.merkle_minimal import calc_merkle_tree_from_leaves, get_merkle_proof
@ -15,6 +16,8 @@ def mock_deposit(spec, state, index):
state.validators[index].activation_eligibility_epoch = spec.FAR_FUTURE_EPOCH
state.validators[index].activation_epoch = spec.FAR_FUTURE_EPOCH
state.validators[index].effective_balance = spec.MAX_EFFECTIVE_BALANCE
if is_post_altair(spec):
state.inactivity_scores[index] = 0
assert not spec.is_active_validator(state.validators[index], spec.get_current_epoch(state))