mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 22:08:30 +00:00
Make to_electra not fallible
This commit is contained in:
@@ -116,11 +116,13 @@ impl<E: EthSpec> IndexedAttestation<E> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_electra(self) -> Result<IndexedAttestationElectra<E>, ssz_types::Error> {
|
||||
Ok(match self {
|
||||
pub fn to_electra(self) -> IndexedAttestationElectra<E> {
|
||||
match self {
|
||||
Self::Base(att) => {
|
||||
let extended_attesting_indices: VariableList<u64, E::MaxValidatorsPerSlot> =
|
||||
VariableList::new(att.attesting_indices.to_vec())?;
|
||||
VariableList::new(att.attesting_indices.to_vec())
|
||||
.expect("MaxValidatorsPerSlot must be >= MaxValidatorsPerCommittee");
|
||||
// TODO: Add test after unstable rebase https://github.com/sigp/lighthouse/blob/474c1b44863927c588dd05ab2ac0f934298398e1/consensus/types/src/eth_spec.rs#L541
|
||||
|
||||
IndexedAttestationElectra {
|
||||
attesting_indices: extended_attesting_indices,
|
||||
@@ -129,7 +131,7 @@ impl<E: EthSpec> IndexedAttestation<E> {
|
||||
}
|
||||
}
|
||||
Self::Electra(att) => att,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user