Struct sc_consensus_pow::PowBlockImport [−][src]
pub struct PowBlockImport<B: BlockT, I, C, S, Algorithm, CAW, CIDP> { /* fields omitted */ }
Expand description
A block importer for PoW.
Implementations
impl<B, I, C, S, Algorithm, CAW, CIDP> PowBlockImport<B, I, C, S, Algorithm, CAW, CIDP> where
B: BlockT,
I: BlockImport<B, Transaction = TransactionFor<C, B>> + Send + Sync,
I::Error: Into<ConsensusError>,
C: ProvideRuntimeApi<B> + Send + Sync + HeaderBackend<B> + AuxStore + ProvideCache<B> + BlockOf,
C::Api: BlockBuilderApi<B>,
Algorithm: PowAlgorithm<B>,
CAW: CanAuthorWith<B>,
CIDP: CreateInherentDataProviders<B, ()>,
impl<B, I, C, S, Algorithm, CAW, CIDP> PowBlockImport<B, I, C, S, Algorithm, CAW, CIDP> where
B: BlockT,
I: BlockImport<B, Transaction = TransactionFor<C, B>> + Send + Sync,
I::Error: Into<ConsensusError>,
C: ProvideRuntimeApi<B> + Send + Sync + HeaderBackend<B> + AuxStore + ProvideCache<B> + BlockOf,
C::Api: BlockBuilderApi<B>,
Algorithm: PowAlgorithm<B>,
CAW: CanAuthorWith<B>,
CIDP: CreateInherentDataProviders<B, ()>,
Trait Implementations
impl<B, I, C, S, Algorithm, CAW, CIDP> BlockImport<B> for PowBlockImport<B, I, C, S, Algorithm, CAW, CIDP> where
B: BlockT,
I: BlockImport<B, Transaction = TransactionFor<C, B>> + Send + Sync,
I::Error: Into<ConsensusError>,
S: SelectChain<B>,
C: ProvideRuntimeApi<B> + Send + Sync + HeaderBackend<B> + AuxStore + ProvideCache<B> + BlockOf,
C::Api: BlockBuilderApi<B>,
Algorithm: PowAlgorithm<B> + Send + Sync,
Algorithm::Difficulty: 'static + Send,
CAW: CanAuthorWith<B> + Send + Sync,
CIDP: CreateInherentDataProviders<B, ()> + Send + Sync,
impl<B, I, C, S, Algorithm, CAW, CIDP> BlockImport<B> for PowBlockImport<B, I, C, S, Algorithm, CAW, CIDP> where
B: BlockT,
I: BlockImport<B, Transaction = TransactionFor<C, B>> + Send + Sync,
I::Error: Into<ConsensusError>,
S: SelectChain<B>,
C: ProvideRuntimeApi<B> + Send + Sync + HeaderBackend<B> + AuxStore + ProvideCache<B> + BlockOf,
C::Api: BlockBuilderApi<B>,
Algorithm: PowAlgorithm<B> + Send + Sync,
Algorithm::Difficulty: 'static + Send,
CAW: CanAuthorWith<B> + Send + Sync,
CIDP: CreateInherentDataProviders<B, ()> + Send + Sync,
type Error = ConsensusError
type Error = ConsensusError
The error type.
type Transaction = TransactionFor<C, B>
type Transaction = TransactionFor<C, B>
The transaction type used by the backend.
fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Check block preconditions.
fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Self::Transaction>,
new_cache: HashMap<CacheKeyId, Vec<u8>>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Self::Transaction>,
new_cache: HashMap<CacheKeyId, Vec<u8>>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Import a block. Read more
Auto Trait Implementations
impl<B, I, C, S, Algorithm, CAW, CIDP> RefUnwindSafe for PowBlockImport<B, I, C, S, Algorithm, CAW, CIDP> where
Algorithm: RefUnwindSafe,
C: RefUnwindSafe,
CAW: RefUnwindSafe,
CIDP: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe,
<<B as Block>::Header as Header>::Number: RefUnwindSafe,
impl<B, I, C, S, Algorithm, CAW, CIDP> Send for PowBlockImport<B, I, C, S, Algorithm, CAW, CIDP> where
Algorithm: Send,
C: Send + Sync,
CAW: Send,
CIDP: Send + Sync,
I: Send,
S: Send,
impl<B, I, C, S, Algorithm, CAW, CIDP> Sync for PowBlockImport<B, I, C, S, Algorithm, CAW, CIDP> where
Algorithm: Sync,
C: Send + Sync,
CAW: Sync,
CIDP: Send + Sync,
I: Sync,
S: Sync,
impl<B, I, C, S, Algorithm, CAW, CIDP> Unpin for PowBlockImport<B, I, C, S, Algorithm, CAW, CIDP> where
Algorithm: Unpin,
CAW: Unpin,
I: Unpin,
S: Unpin,
<<B as Block>::Header as Header>::Number: Unpin,
impl<B, I, C, S, Algorithm, CAW, CIDP> UnwindSafe for PowBlockImport<B, I, C, S, Algorithm, CAW, CIDP> where
Algorithm: UnwindSafe,
C: RefUnwindSafe,
CAW: UnwindSafe,
CIDP: RefUnwindSafe,
I: UnwindSafe,
S: UnwindSafe,
<<B as Block>::Header as Header>::Number: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more