From 7f70a7704b022857ca05a6d084c6f0c0f5c8bd60 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Wed, 18 Aug 2021 15:43:33 -0600 Subject: [PATCH] fix validator state during deposit randomization --- tests/core/pyspec/eth2spec/test/helpers/deposits.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/core/pyspec/eth2spec/test/helpers/deposits.py b/tests/core/pyspec/eth2spec/test/helpers/deposits.py index 48057a1d9..4e2621522 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/deposits.py +++ b/tests/core/pyspec/eth2spec/test/helpers/deposits.py @@ -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))