Trait sp_consensus::Environment[][src]

pub trait Environment<B: BlockT> {
    type Proposer: Proposer<B> + Send + 'static;
    type CreateProposer: Future<Output = Result<Self::Proposer, Self::Error>> + Send + Unpin + 'static;
    type Error: From<Error> + Debug + 'static;
    fn init(&mut self, parent_header: &B::Header) -> Self::CreateProposer;
}
Expand description

Environment for a Consensus instance.

Creates proposer instance.

Associated Types

The proposer type this creates.

A future that resolves to the proposer.

Error which can occur upon creation.

Required methods

Initialize the proposal logic on top of a specific header. Provide the authorities at that header.

Implementors

impl<A, B, Block, C, PR> Environment<Block> for ProposerFactory<A, B, C, PR> where
    A: TransactionPool<Block = Block> + 'static,
    B: Backend<Block> + Send + Sync + 'static,
    Block: BlockT,
    C: BlockBuilderProvider<B, Block, C> + HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + 'static,
    C::Api: ApiExt<Block, StateBackend = StateBackendFor<B, Block>> + BlockBuilderApi<Block>,
    PR: ProofRecording