Proposer

Trait Proposer 

Source
pub trait Proposer<B: BlockT> {
    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.

Implementors§