compilation fix in beacon chain tests

This commit is contained in:
realbigsean
2023-04-26 17:28:24 -04:00
parent 2cad638f41
commit 3c9fb78aa1
2 changed files with 18 additions and 4 deletions

View File

@@ -501,6 +501,17 @@ pub enum MaybeAvailableBlock<E: EthSpec> {
AvailabilityPending(AvailabilityPendingBlock<E>),
}
impl<T: EthSpec> TryInto<AvailableBlock<T>> for MaybeAvailableBlock<T> {
type Error = AvailabilityCheckError;
fn try_into(self) -> Result<AvailableBlock<T>, Self::Error> {
match self {
Self::Available(block) => Ok(block),
Self::AvailabilityPending(_) => Err(AvailabilityCheckError::MissingBlobs),
}
}
}
/// Trait for common block operations.
pub trait AsBlock<E: EthSpec> {
fn slot(&self) -> Slot;