Trait vault::relay::Issuing

source ·
pub trait Issuing {
    // Required methods
    fn is_initialized<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn initialize<'life0, 'async_trait>(
        &'life0 self,
        header: Vec<u8>,
        height: u32
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn submit_block_header<'life0, 'async_trait>(
        &'life0 self,
        header: Vec<u8>,
        random_delay: Arc<Box<dyn RandomDelay + Send + Sync>>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn submit_block_header_batch<'life0, 'async_trait>(
        &'life0 self,
        headers: Vec<Vec<u8>>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_best_height<'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_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;
    fn is_block_stored<'life0, 'async_trait>(
        &'life0 self,
        hash_le: Vec<u8>
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

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

Returns true if the light client is initialized

source

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

Initialize the light client

Arguments
  • header - Raw block header
  • height - Starting height
source

fn submit_block_header<'life0, 'async_trait>( &'life0 self, header: Vec<u8>, random_delay: Arc<Box<dyn RandomDelay + Send + Sync>> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Submit a block header and wait for inclusion

Arguments
  • header - Raw block header
source

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

Submit a batch of block headers and wait for inclusion

Arguments
  • headers - Raw block headers (multiple of 80 bytes)
source

fn get_best_height<'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 light client’s chain tip

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 block hash stored at a given height, this is assumed to be in little-endian format

Arguments
  • height - Height of the block to fetch
source

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

Returns true if the block described by the hash has been stored in the light client

Arguments
  • hash_le - Hash (little-endian) of the block

Implementations on Foreign Types§

source§

impl Issuing for InterBtcParachain

source§

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

source§

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

source§

fn submit_block_header<'life0, 'async_trait>( &'life0 self, header: Vec<u8>, random_delay: Arc<Box<dyn RandomDelay + Send + Sync>> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

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

source§

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

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,

source§

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

Implementors§