diff --git a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py index 2de054505..6d05a498e 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py @@ -50,6 +50,18 @@ def validate_resulting_balances(spec, pre_state, post_state, attestations): assert post_state.balances[index] > pre_state.balances[index] else: assert post_state.balances[index] < pre_state.balances[index] + else: + if spec.is_in_inactivity_leak(post_state): + if index in attesting_indices: + # If not proposer but participated optimally, should have exactly neutral balance + assert post_state.balances[index] == pre_state.balances[index] + else: + assert post_state.balances[index] < pre_state.balances[index] + else: + if index in attesting_indices: + assert post_state.balances[index] > pre_state.balances[index] + else: + assert post_state.balances[index] < pre_state.balances[index] @with_all_phases