From 0cc5f9cd59369ead4088b07580817fb66a5fc6e0 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Wed, 1 Sep 2021 14:43:11 -0700 Subject: [PATCH] modify helper for more precision on exited validators --- tests/core/pyspec/eth2spec/test/helpers/state.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/helpers/state.py b/tests/core/pyspec/eth2spec/test/helpers/state.py index b4c9e1d67..d8fda3754 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/state.py +++ b/tests/core/pyspec/eth2spec/test/helpers/state.py @@ -1,6 +1,6 @@ from eth2spec.test.context import expect_assertion_error, is_post_altair from eth2spec.test.helpers.block import apply_empty_block, sign_block, transition_unsigned_block -from eth2spec.test.helpers.voluntary_exits import get_exited_validators +from eth2spec.test.helpers.voluntary_exits import get_unslashed_exited_validators def get_balance(state, index): @@ -142,7 +142,7 @@ def ensure_state_has_validators_across_lifecycle(spec, state): for each of the following lifecycle states: 1. Pending / deposited 2. Active - 3. Exited + 3. Exited (but not slashed) 4. Slashed """ has_pending = any(filter(spec.is_eligible_for_activation_queue, state.validators)) @@ -150,7 +150,7 @@ def ensure_state_has_validators_across_lifecycle(spec, state): current_epoch = spec.get_current_epoch(state) has_active = any(filter(lambda v: spec.is_active_validator(v, current_epoch), state.validators)) - has_exited = any(get_exited_validators(spec, state)) + has_exited = any(get_unslashed_exited_validators(spec, state)) has_slashed = any(filter(lambda v: v.slashed, state.validators))