modify helper for more precision on exited validators

This commit is contained in:
Alex Stokes 2021-09-01 14:43:11 -07:00
parent cf23cd00ab
commit 0cc5f9cd59
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69
1 changed files with 3 additions and 3 deletions

View File

@ -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))