Split validator into ValidatorMutable

This commit is contained in:
Michael Sproul
2022-09-28 11:43:58 +10:00
parent 9ec454aa52
commit 9a1799f235
22 changed files with 133 additions and 97 deletions

View File

@@ -99,13 +99,13 @@ pub fn validator_inclusion_data<T: BeaconChainTypes>(
let summary = get_epoch_processing_summary(&mut state, &chain.spec)?;
Ok(Some(ValidatorInclusionData {
is_slashed: validator.slashed,
is_slashed: validator.slashed(),
is_withdrawable_in_current_epoch: validator.is_withdrawable_at(epoch),
is_active_unslashed_in_current_epoch: summary
.is_active_unslashed_in_current_epoch(validator_index),
is_active_unslashed_in_previous_epoch: summary
.is_active_unslashed_in_previous_epoch(validator_index),
current_epoch_effective_balance_gwei: validator.effective_balance,
current_epoch_effective_balance_gwei: validator.effective_balance(),
is_current_epoch_target_attester: summary
.is_current_epoch_target_attester(validator_index)
.map_err(convert_cache_error)?,