mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 21:34:46 +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)
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ pub mod base;
|
||||
|
||||
pub use deposit_data_tree::DepositDataTree;
|
||||
pub use get_attestation_participation::get_attestation_participation_flag_indices;
|
||||
pub use get_attesting_indices::get_attesting_indices;
|
||||
pub use get_attesting_indices::{get_attesting_indices, get_attesting_indices_from_state};
|
||||
pub use get_indexed_attestation::get_indexed_attestation;
|
||||
pub use initiate_validator_exit::initiate_validator_exit;
|
||||
pub use slash_validator::slash_validator;
|
||||
|
||||
Reference in New Issue
Block a user