referrerpolicy=no-referrer-when-downgrade
pub trait BlockAnnounceValidator<B>
where B: Block,
{ // Required method fn validate( &mut self, header: &<B as Block>::Header, data: &[u8], ) -> Pin<Box<dyn Future<Output = Result<Validation, Box<dyn Error + Send>>> + Send>>; }
Expand description

Type which checks incoming block announcements.

Required Methods§

source

fn validate( &mut self, header: &<B as Block>::Header, data: &[u8], ) -> Pin<Box<dyn Future<Output = Result<Validation, Box<dyn Error + Send>>> + Send>>

Validate the announced header and its associated data.

§Note

Returning Validation::Failure will lead to a decrease of the peers reputation as it sent us invalid data.

The returned future should only resolve to an error if there was an internal error validating the block announcement. If the block announcement itself is invalid, this should always return Validation::Failure.

Implementations on Foreign Types§

§

impl<Block> BlockAnnounceValidator<Block> for AssumeSybilResistance
where Block: Block,

§

fn validate( &mut self, _header: &<Block as Block>::Header, data: &[u8], ) -> Pin<Box<dyn Future<Output = Result<Validation, Box<dyn Error + Send>>> + Send>>

§

impl<Block, RCInterface> BlockAnnounceValidator<Block> for RequireSecondedInBlockAnnounce<Block, RCInterface>
where Block: Block, RCInterface: RelayChainInterface + Clone + 'static,

§

fn validate( &mut self, header: &<Block as Block>::Header, data: &[u8], ) -> Pin<Box<dyn Future<Output = Result<Validation, Box<dyn Error + Send>>> + Send>>

Implementors§