Skip to main content

Validator

Trait Validator 

Source
pub trait Validator:
    Send
    + Sync
    + 'static {
    // Required methods
    fn add_session(&self, info: AddSession<'_>) -> Result<()>;
    fn validate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: ValidationSessionId,
        block_id: &'life1 BlockId,
    ) -> Pin<Box<dyn Future<Output = Result<ValidationStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn cancel_validation(
        &self,
        before: &BlockIdShort,
        session_id: Option<ValidationSessionId>,
    ) -> Result<()>;
}

Required Methods§

Source

fn add_session(&self, info: AddSession<'_>) -> Result<()>

Adds a new session for the specified shard.

Source

fn validate<'life0, 'life1, 'async_trait>( &'life0 self, session_id: ValidationSessionId, block_id: &'life1 BlockId, ) -> Pin<Box<dyn Future<Output = Result<ValidationStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Collects signatures for the specified block.

Source

fn cancel_validation( &self, before: &BlockIdShort, session_id: Option<ValidationSessionId>, ) -> Result<()>

Cancels validation before the specified block.

If session_id is provided, it will be used to directly cancel the specific session, avoiding unnecessary lookups and potential ambiguity.

Implementors§