ensure rewards spec test with exited validators

This commit is contained in:
Alex Stokes 2021-09-01 14:44:06 -07:00
parent 0cc5f9cd59
commit 58c0da9059
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69

View File

@ -37,6 +37,20 @@ def test_full_random_3(spec, state):
yield from rewards_helpers.run_test_full_random(spec, state, rng=Random(4040)) yield from rewards_helpers.run_test_full_random(spec, state, rng=Random(4040))
@with_all_phases
@spec_state_test
def test_full_random_4(spec, state):
"""
Ensure a rewards test with some exited (but not slashed) validators.
"""
rng = Random(5050)
randomize_state(spec, state, rng)
assert spec.is_in_inactivity_leak(state)
target_validators = get_unslashed_exited_validators(spec, state)
assert len(target_validators) != 0
yield from rewards_helpers.run_deltas(spec, state)
@with_all_phases @with_all_phases
@with_custom_state(balances_fn=low_balances, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) @with_custom_state(balances_fn=low_balances, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE)
@spec_test @spec_test