modify helper for more precision on exited validators
This commit is contained in:
parent
cf23cd00ab
commit
0cc5f9cd59
|
@ -1,6 +1,6 @@
|
||||||
from eth2spec.test.context import expect_assertion_error, is_post_altair
|
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.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):
|
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:
|
for each of the following lifecycle states:
|
||||||
1. Pending / deposited
|
1. Pending / deposited
|
||||||
2. Active
|
2. Active
|
||||||
3. Exited
|
3. Exited (but not slashed)
|
||||||
4. Slashed
|
4. Slashed
|
||||||
"""
|
"""
|
||||||
has_pending = any(filter(spec.is_eligible_for_activation_queue, state.validators))
|
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)
|
current_epoch = spec.get_current_epoch(state)
|
||||||
has_active = any(filter(lambda v: spec.is_active_validator(v, current_epoch), state.validators))
|
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))
|
has_slashed = any(filter(lambda v: v.slashed, state.validators))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue