Trait sp_consensus::Proposer[][src]

pub trait Proposer<B: BlockT> {
    type Error: From<Error> + Debug + 'static;
    type Transaction: Default + Send + 'static;
    type Proposal: Future<Output = Result<Proposal<B, Self::Transaction, Self::Proof>, Self::Error>> + Send + Unpin + 'static;
    type ProofRecording: ProofRecording<Proof = Self::Proof> + Send + Sync + 'static;
    type Proof: Send + Sync + 'static;
    fn propose(
        self,
        inherent_data: InherentData,
        inherent_digests: DigestFor<B>,
        max_duration: Duration
    ) -> Self::Proposal; }

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.

Associated Types

type Error: From<Error> + Debug + 'static[src]

Error type which can occur when proposing or evaluating.

type Transaction: Default + Send + 'static[src]

The transaction type used by the backend.

type Proposal: Future<Output = Result<Proposal<B, Self::Transaction, Self::Proof>, Self::Error>> + Send + Unpin + 'static[src]

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

type ProofRecording: ProofRecording<Proof = Self::Proof> + Send + Sync + 'static[src]

The supported proof recording by the implementator of this trait. See ProofRecording for more information.

type Proof: Send + Sync + 'static[src]

The proof type used by Self::ProofRecording.

Loading content...

Required methods

fn propose(
    self,
    inherent_data: InherentData,
    inherent_digests: DigestFor<B>,
    max_duration: Duration
) -> Self::Proposal
[src]

Create a proposal.

Gets the inherent_data and inherent_digests as input for the proposal. Additionally a maximum duration for building this proposal is given. If building the proposal takes longer than this maximum, the proposal will be very likely discarded.

Return

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

Loading content...

Implementors

Loading content...