Trait vault::relay::Backing

source ·
pub trait Backing {
    // Required methods
    fn get_block_count<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_block_header<'life0, 'async_trait>(
        &'life0 self,
        height: u32
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_block_hash<'life0, 'async_trait>(
        &'life0 self,
        height: u32
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn get_block_count<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the height of the longest chain

source

fn get_block_header<'life0, 'async_trait>( &'life0 self, height: u32 ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the raw header of a block in storage

Arguments
  • height - The height of the block to fetch
source

fn get_block_hash<'life0, 'async_trait>( &'life0 self, height: u32 ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the (little endian) hash of a block

Arguments
  • height - The height of the block to fetch

Implementors§