Trait polkadot_service::HeaderProvider
source · pub trait HeaderProvider<Block, Error = Error>: Send + Sync + 'static{
// Required methods
fn header(
&self,
hash: <Block as BlockT>::Hash,
) -> Result<Option<<Block as BlockT>::Header>, Error>;
fn number(
&self,
hash: <Block as BlockT>::Hash,
) -> Result<Option<<<Block as BlockT>::Header as HeaderT>::Number>, Error>;
}
Expand description
Provides the header and block number for a hash.
Decouples sc_client_api::Backend
and sp_blockchain::HeaderBackend
.