mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-07 10:09:26 +00:00
compilation fix in beacon chain tests
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![cfg(not(debug_assertions))]
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
use beacon_chain::blob_verification::BlockWrapper;
|
||||
use beacon_chain::test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy};
|
||||
use beacon_chain::{StateSkipConfig, WhenSlotSkipped};
|
||||
@@ -135,7 +134,9 @@ async fn produces_attestations() {
|
||||
let block_wrapper: BlockWrapper<MainnetEthSpec> = Arc::new(block.clone()).into();
|
||||
let available_block = chain
|
||||
.data_availability_checker
|
||||
.try_check_availability(block_wrapper)
|
||||
.check_availability(block_wrapper)
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
|
||||
let early_attestation = {
|
||||
@@ -203,7 +204,9 @@ async fn early_attester_cache_old_request() {
|
||||
let available_block = harness
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.try_check_availability(block_wrapper)
|
||||
.check_availability(block_wrapper)
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
|
||||
harness
|
||||
|
||||
Reference in New Issue
Block a user