referrerpolicy=no-referrer-when-downgrade
substrate_test_runtime_client::sp_consensus

Trait Environment

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

Environment for a Consensus instance.

Creates proposer instance.

Required Associated Types§

Source

type Proposer: Proposer<B> + Send + 'static

The proposer type this creates.

Source

type CreateProposer: Future<Output = Result<Self::Proposer, Self::Error>> + Send + Unpin + 'static

A future that resolves to the proposer.

Source

type Error: From<Error> + Error + 'static

Error which can occur upon creation.

Required Methods§

Source

fn init(&mut self, parent_header: &<B as Block>::Header) -> Self::CreateProposer

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

Implementors§

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