mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +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>),
|
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.
|
/// Trait for common block operations.
|
||||||
pub trait AsBlock<E: EthSpec> {
|
pub trait AsBlock<E: EthSpec> {
|
||||||
fn slot(&self) -> Slot;
|
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::blob_verification::BlockWrapper;
|
||||||
use beacon_chain::test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy};
|
use beacon_chain::test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy};
|
||||||
use beacon_chain::{StateSkipConfig, WhenSlotSkipped};
|
use beacon_chain::{StateSkipConfig, WhenSlotSkipped};
|
||||||
@@ -135,7 +134,9 @@ async fn produces_attestations() {
|
|||||||
let block_wrapper: BlockWrapper<MainnetEthSpec> = Arc::new(block.clone()).into();
|
let block_wrapper: BlockWrapper<MainnetEthSpec> = Arc::new(block.clone()).into();
|
||||||
let available_block = chain
|
let available_block = chain
|
||||||
.data_availability_checker
|
.data_availability_checker
|
||||||
.try_check_availability(block_wrapper)
|
.check_availability(block_wrapper)
|
||||||
|
.unwrap()
|
||||||
|
.try_into()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let early_attestation = {
|
let early_attestation = {
|
||||||
@@ -203,7 +204,9 @@ async fn early_attester_cache_old_request() {
|
|||||||
let available_block = harness
|
let available_block = harness
|
||||||
.chain
|
.chain
|
||||||
.data_availability_checker
|
.data_availability_checker
|
||||||
.try_check_availability(block_wrapper)
|
.check_availability(block_wrapper)
|
||||||
|
.unwrap()
|
||||||
|
.try_into()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
harness
|
harness
|
||||||
|
|||||||
Reference in New Issue
Block a user