Use spec function for total active balance

This commit is contained in:
Alex Stokes 2021-09-07 12:23:57 -07:00
parent fb4a4f6694
commit 064b489d18
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69

View File

@ -162,8 +162,6 @@ def has_active_balance_differential(spec, state):
Ensure there is a difference between the total balance of
all _active_ validators and _all_ validators.
"""
epoch = spec.get_current_epoch(state)
active_indices = spec.get_active_validator_indices(state, epoch)
active_balance = spec.get_total_balance(state, set(active_indices))
active_balance = spec.get_total_active_balance(state)
total_balance = spec.get_total_balance(state, set(range(len(state.validators))))
return active_balance // spec.EFFECTIVE_BALANCE_INCREMENT != total_balance // spec.EFFECTIVE_BALANCE_INCREMENT