ensure rewards are tested properly post altair fork

This commit is contained in:
Danny Ryan 2021-03-10 13:11:03 -07:00
parent e2abdb74ae
commit 37c49ffcdc
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A

View File

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