pub trait MmrApi: RuntimeApi {
    type Error;
    type BlockNumber;
    type EncodableOpaqueLeaf;
    type Proof;

    // Required methods
    fn generate_proof<'life0, 'async_trait>(
        &'life0 self,
        block_numbers: Vec<Self::BlockNumber>,
        best_known_block_number: Option<Self::BlockNumber>,
        at_block: Option<Self::Hash>
    ) -> Pin<Box<dyn Future<Output = Result<StdResult<(Vec<Self::EncodableOpaqueLeaf>, Self::Proof), Self::Error>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn root<'life0, 'async_trait>(
        &'life0 self,
        at_block: Option<Self::Hash>
    ) -> Pin<Box<dyn Future<Output = Result<StdResult<Vec<Self::Hash>, Self::Error>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn verify_proof<'life0, 'async_trait>(
        &'life0 self,
        leaves: Vec<Self::EncodableOpaqueLeaf>,
        proof: Self::Proof,
        at_block: Option<Self::Hash>
    ) -> Pin<Box<dyn Future<Output = Result<StdResult<(), Self::Error>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn verify_proof_stateless<'life0, 'async_trait>(
        &'life0 self,
        root: Self::Hash,
        leaves: Vec<Self::EncodableOpaqueLeaf>,
        proof: Self::Proof,
        at_block: Option<Self::Hash>
    ) -> Pin<Box<dyn Future<Output = Result<StdResult<(), Self::Error>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

source

fn generate_proof<'life0, 'async_trait>( &'life0 self, block_numbers: Vec<Self::BlockNumber>, best_known_block_number: Option<Self::BlockNumber>, at_block: Option<Self::Hash> ) -> Pin<Box<dyn Future<Output = Result<StdResult<(Vec<Self::EncodableOpaqueLeaf>, Self::Proof), Self::Error>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Generate MMR proof for the given block numbers.

source

fn root<'life0, 'async_trait>( &'life0 self, at_block: Option<Self::Hash> ) -> Pin<Box<dyn Future<Output = Result<StdResult<Vec<Self::Hash>, Self::Error>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the on-chain MMR root hash.

source

fn verify_proof<'life0, 'async_trait>( &'life0 self, leaves: Vec<Self::EncodableOpaqueLeaf>, proof: Self::Proof, at_block: Option<Self::Hash> ) -> Pin<Box<dyn Future<Output = Result<StdResult<(), Self::Error>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Verify MMR proof against on-chain MMR.

source

fn verify_proof_stateless<'life0, 'async_trait>( &'life0 self, root: Self::Hash, leaves: Vec<Self::EncodableOpaqueLeaf>, proof: Self::Proof, at_block: Option<Self::Hash> ) -> Pin<Box<dyn Future<Output = Result<StdResult<(), Self::Error>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Verify MMR proof against given root hash.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, Client> MmrApi for RuntimeApiClient<T, Client>
where T: Config, Client: Request,