mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
Added more test coverage, simplified Attestation conversion, and other minor refactors
This commit is contained in:
@@ -325,14 +325,16 @@ impl<T: BeaconChainTypes> VerifiedUnaggregatedAttestation<'_, T> {
|
||||
self.indexed_attestation
|
||||
}
|
||||
|
||||
pub fn single_attestation(&self) -> SingleAttestation {
|
||||
// TODO(single-attestation) unwrap
|
||||
SingleAttestation {
|
||||
committee_index: self.attestation.committee_index().unwrap_or(0) as usize,
|
||||
pub fn single_attestation(&self) -> Option<SingleAttestation> {
|
||||
let Some(committee_index) = self.attestation.committee_index() else {
|
||||
return None;
|
||||
};
|
||||
Some(SingleAttestation {
|
||||
committee_index: committee_index as usize,
|
||||
attester_index: self.validator_index,
|
||||
data: self.attestation.data().clone(),
|
||||
signature: self.attestation.signature().clone(),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user