mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 06:14:38 +00:00
Fix tests and block rewards API
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
use types::*;
|
||||
|
||||
/// Returns validator indices which participated in the attestation, sorted by increasing index.
|
||||
///
|
||||
/// Spec v0.12.1
|
||||
pub fn get_attesting_indices<T: EthSpec>(
|
||||
committee: &[usize],
|
||||
bitlist: &BitList<T::MaxValidatorsPerCommittee>,
|
||||
@@ -23,3 +21,12 @@ pub fn get_attesting_indices<T: EthSpec>(
|
||||
|
||||
Ok(indices)
|
||||
}
|
||||
|
||||
/// Shortcut for getting the attesting indices while fetching the committee from the state's cache.
|
||||
pub fn get_attesting_indices_from_state<T: EthSpec>(
|
||||
state: &BeaconState<T>,
|
||||
att: &Attestation<T>,
|
||||
) -> Result<Vec<u64>, BeaconStateError> {
|
||||
let committee = state.get_beacon_committee(att.data.slot, att.data.index)?;
|
||||
get_attesting_indices::<T>(&committee.committee, &att.aggregation_bits)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user