use std::sync::Arc; use async_trait::async_trait; use sp_inherents::CreateInherentDataProviders; use sp_runtime::traits::Block; use sp_api::TransactionFor; use sp_consensus::{Error, CacheKeyId, Environment}; use sc_consensus::{BlockImportParams, BlockImport, Verifier}; use sc_client_api::Backend; use sp_tendermint::TendermintApi; use crate::{ tendermint::{TendermintClient, TendermintImport}, Announce, }; #[async_trait] impl< B: Block, Be: Backend + 'static, C: TendermintClient, CIDP: CreateInherentDataProviders + 'static, E: Send + Sync + Environment + 'static, A: Announce, > Verifier for TendermintImport where TransactionFor: Send + Sync + 'static, Arc: BlockImport>, as BlockImport>::Error: Into, C::Api: TendermintApi, { async fn verify( &mut self, mut block: BlockImportParams, ) -> Result<(BlockImportParams, Option)>>), String> { self.check(&mut block).await.map_err(|e| format!("{}", e))?; Ok((block, None)) } }