Trait noble_mmr_primitives::MmrApi[][src]

pub trait MmrApi<Block: BlockT, Leaf: Codec, Hash: Codec>: Core<Block> {
    fn generate_proof(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        leaf_index: u64
    ) -> Result<Result<(Leaf, Proof<Hash>), Error>, Self::Error> { ... }
fn generate_proof_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        leaf_index: u64
    ) -> Result<Result<(Leaf, Proof<Hash>), Error>, Self::Error> { ... }
fn verify_proof(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        leaf: Leaf,
        proof: Proof<Hash>
    ) -> Result<Result<(), Error>, Self::Error> { ... }
fn verify_proof_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        leaf: Leaf,
        proof: Proof<Hash>
    ) -> Result<Result<(), Error>, Self::Error> { ... }
fn verify_proof_stateless(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        root: Hash,
        leaf: Vec<u8>,
        proof: Proof<Hash>
    ) -> Result<Result<(), Error>, Self::Error> { ... }
fn verify_proof_stateless_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        root: Hash,
        leaf: Vec<u8>,
        proof: Proof<Hash>
    ) -> Result<Result<(), Error>, Self::Error> { ... } }

API to interact with MMR noble.

Provided methods

fn generate_proof(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    leaf_index: u64
) -> Result<Result<(Leaf, Proof<Hash>), Error>, Self::Error>
[src]

Generate MMR proof for a leaf under given index.

fn generate_proof_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    leaf_index: u64
) -> Result<Result<(Leaf, Proof<Hash>), Error>, Self::Error>
[src]

Generate MMR proof for a leaf under given index.

fn verify_proof(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    leaf: Leaf,
    proof: Proof<Hash>
) -> Result<Result<(), Error>, Self::Error>
[src]

Verify MMR proof against on-chain MMR.

Note this function will use on-chain MMR root hash and check if the proof matches the hash. See Self::verify_proof_stateless for a stateless verifier.

fn verify_proof_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    leaf: Leaf,
    proof: Proof<Hash>
) -> Result<Result<(), Error>, Self::Error>
[src]

Verify MMR proof against on-chain MMR.

Note this function will use on-chain MMR root hash and check if the proof matches the hash. See Self::verify_proof_stateless for a stateless verifier.

fn verify_proof_stateless(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    root: Hash,
    leaf: Vec<u8>,
    proof: Proof<Hash>
) -> Result<Result<(), Error>, Self::Error>
[src]

Verify MMR proof against given root hash.

Note this function does not require any on-chain storage - the proof is verified against given MMR root hash.

The leaf data is expected to be encoded in it’s compact form.

fn verify_proof_stateless_with_context(
    &self,
    __runtime_api_at_param__: &BlockId<Block>,
    context: ExecutionContext,
    root: Hash,
    leaf: Vec<u8>,
    proof: Proof<Hash>
) -> Result<Result<(), Error>, Self::Error>
[src]

Verify MMR proof against given root hash.

Note this function does not require any on-chain storage - the proof is verified against given MMR root hash.

The leaf data is expected to be encoded in it’s compact form.

Loading content...

Trait Implementations

impl<Block: BlockT, Leaf: Codec, Hash: Codec, __Sr_Api_Error__> RuntimeApiInfo for dyn MmrApi<Block, Leaf, Hash, Error = __Sr_Api_Error__>[src]

Implementors

Loading content...