Skip to main content

ProcessableCertificate

Trait ProcessableCertificate 

Source
pub trait ProcessableCertificate:
    CertificateValue
    + Sized
    + 'static
    + Send {
    type Certificate: Certified<Value = Self> + Clone + Send + Sync + 'static;

    // Required methods
    fn make_certificate(
        quorum: GenericCertificate<Self>,
        justification: JustificationChain,
    ) -> Self::Certificate;
    fn process_certificate<S: Storage + Clone + 'static>(
        worker: &WorkerState<S>,
        certificate: Self::Certificate,
    ) -> impl Future<Output = Result<(ChainInfoResponse, NetworkActions), WorkerError>> + Send;
}
Expand description

A certificate value that the worker knows how to process.

Required Associated Types§

Source

type Certificate: Certified<Value = Self> + Clone + Send + Sync + 'static

The concrete certificate type carrying this value (and, for block values, its justification chain).

Required Methods§

Source

fn make_certificate( quorum: GenericCertificate<Self>, justification: JustificationChain, ) -> Self::Certificate

Builds the concrete certificate from a signed quorum and a justification chain. The chain is ignored for values (such as Timeout) that carry no justification.

Source

fn process_certificate<S: Storage + Clone + 'static>( worker: &WorkerState<S>, certificate: Self::Certificate, ) -> impl Future<Output = Result<(ChainInfoResponse, NetworkActions), WorkerError>> + Send

Processes a certificate carrying this value on the given worker.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ProcessableCertificate for ConfirmedBlock

Source§

impl ProcessableCertificate for Timeout

Source§

impl ProcessableCertificate for ValidatedBlock

Implementors§