Trait substrate_api_client::api::rpc_api::chain::GetChainInfo
source · pub trait GetChainInfo {
type BlockNumber;
type Hash;
type Header;
type Block;
// Required methods
fn get_finalized_head<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Hash>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_header<'life0, 'async_trait>(
&'life0 self,
hash: Option<Self::Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Header>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_hash<'life0, 'async_trait>(
&'life0 self,
number: Option<Self::BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Hash>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_genesis_block<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Block>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block<'life0, 'async_trait>(
&'life0 self,
hash: Option<Self::Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Block>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_by_num<'life0, 'async_trait>(
&'life0 self,
number: Option<Self::BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Block>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_signed_block<'life0, 'async_trait>(
&'life0 self,
hash: Option<Self::Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock<Self::Block>>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_signed_block_by_num<'life0, 'async_trait>(
&'life0 self,
number: Option<Self::BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock<Self::Block>>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_finalized_block<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock<Self::Block>>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_signed_blocks<'life0, 'life1, 'async_trait>(
&'life0 self,
block_numbers: &'life1 [Self::BlockNumber]
) -> Pin<Box<dyn Future<Output = Result<Vec<SignedBlock<Self::Block>>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Required Associated Types§
Required Methods§
fn get_finalized_head<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Hash>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_header<'life0, 'async_trait>(
&'life0 self,
hash: Option<Self::Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Header>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_hash<'life0, 'async_trait>(
&'life0 self,
number: Option<Self::BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Hash>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
sourcefn get_genesis_block<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Block>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_genesis_block<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Block>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the genesis block
fn get_block<'life0, 'async_trait>(
&'life0 self,
hash: Option<Self::Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Block>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_by_num<'life0, 'async_trait>(
&'life0 self,
number: Option<Self::BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Block>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
sourcefn get_signed_block<'life0, 'async_trait>(
&'life0 self,
hash: Option<Self::Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock<Self::Block>>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_signed_block<'life0, 'async_trait>(
&'life0 self,
hash: Option<Self::Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock<Self::Block>>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
A signed block is a block with Justification ,i.e., a Grandpa finality proof.
The interval at which finality proofs are provided is set via the
the GrandpaConfig.justification_period
in a node’s service.rs.
The Justification may be None.
fn get_signed_block_by_num<'life0, 'async_trait>(
&'life0 self,
number: Option<Self::BlockNumber>
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock<Self::Block>>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
sourcefn get_finalized_block<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock<Self::Block>>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_finalized_block<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock<Self::Block>>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the last finalized signed block.
sourcefn get_signed_blocks<'life0, 'life1, 'async_trait>(
&'life0 self,
block_numbers: &'life1 [Self::BlockNumber]
) -> Pin<Box<dyn Future<Output = Result<Vec<SignedBlock<Self::Block>>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_signed_blocks<'life0, 'life1, 'async_trait>(
&'life0 self,
block_numbers: &'life1 [Self::BlockNumber]
) -> Pin<Box<dyn Future<Output = Result<Vec<SignedBlock<Self::Block>>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a vector containing the blocks with the block numbers given in the input parameter.
If fetching any of the block fails then a Result::Err
will be returned.