referrerpolicy=no-referrer-when-downgrade

Trait Proposer

Source
pub trait Proposer<B>
where B: Block,
{ type Error: From<Error> + Send + Sync + Error + 'static; type Proposal: Future<Output = Result<Proposal<B>, Self::Error>> + Send + Unpin + 'static; // Required method fn propose(self, args: ProposeArgs<B>) -> Self::Proposal; }
Expand description

Logic for a proposer.

This will encapsulate creation and evaluation of proposals at a specific block.

Proposers are generic over bits of “consensus data” which are engine-specific.

Required Associated Types§

Source

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

Error type which can occur when proposing or evaluating.

Source

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

Future that resolves to a committed proposal with an optional proof.

Required Methods§

Source

fn propose(self, args: ProposeArgs<B>) -> Self::Proposal

Create a proposal.

Takes a ProposeArgs struct containing all the necessary parameters for block production including inherent data, digests, duration limits, storage proof recorder, and extensions.

§Return

Returns a future that resolves to a Proposal or to Error.

Implementations on Foreign Types§

Source§

impl<A, Block, C> Proposer<Block> for Proposer<Block, C, A>
where A: TransactionPool<Block = Block> + 'static, Block: Block, C: HeaderBackend<Block> + ProvideRuntimeApi<Block> + CallApiAt<Block> + Send + Sync + 'static, <C as ProvideRuntimeApi<Block>>::Api: ApiExt<Block> + BlockBuilder<Block>,

Source§

type Proposal = Pin<Box<dyn Future<Output = Result<Proposal<Block>, <Proposer<Block, C, A> as Proposer<Block>>::Error>> + Send>>

Source§

type Error = Error

Source§

fn propose( self, args: ProposeArgs<Block>, ) -> <Proposer<Block, C, A> as Proposer<Block>>::Proposal

Implementors§