Trait noble_mmr_primitives::LeafDataProvider[][src]

pub trait LeafDataProvider {
    type LeafData: FullLeaf + Decode;
    fn leaf_data() -> Self::LeafData;
}

A provider of the MMR’s leaf data.

Associated Types

type LeafData: FullLeaf + Decode[src]

A type that should end up in the leaf of MMR.

Loading content...

Required methods

fn leaf_data() -> Self::LeafData[src]

The method to return leaf data that should be placed in the leaf node appended MMR at this block.

This is being called by the on_initialize method of this noble at the very beginning of each block.

Loading content...

Implementations on Foreign Types

impl LeafDataProvider for ()[src]

type LeafData = ()

impl<T: Config> LeafDataProvider for Module<T>[src]

The most common use case for MMRs is to store historical block hashes, so that any point in time in the future we can receive a proof about some past blocks without using excessive on-chain storage.

Hence we implement the LeafDataProvider for fabric_system::Module. Since the current block hash is not available (since the block is not finished yet), we use the parent_hash here along with parent block number.

type LeafData = (<T as Config>::BlockNumber, <T as Config>::Hash)

impl<A> LeafDataProvider for (A,) where
    (A::LeafData,): FullLeaf,
    A: LeafDataProvider
[src]

LeafDataProvider implementation for (Tuple, ...)

This provides regular (non-compactable) composition of LeafDataProviders.

impl<A, B> LeafDataProvider for (A, B) where
    (A::LeafData, B::LeafData): FullLeaf,
    A: LeafDataProvider,
    B: LeafDataProvider
[src]

LeafDataProvider implementation for (Tuple, ...)

This provides regular (non-compactable) composition of LeafDataProviders.

impl<A, B, C> LeafDataProvider for (A, B, C) where
    (A::LeafData, B::LeafData, C::LeafData): FullLeaf,
    A: LeafDataProvider,
    B: LeafDataProvider,
    C: LeafDataProvider
[src]

LeafDataProvider implementation for (Tuple, ...)

This provides regular (non-compactable) composition of LeafDataProviders.

impl<A, B, C, D> LeafDataProvider for (A, B, C, D) where
    (A::LeafData, B::LeafData, C::LeafData, D::LeafData): FullLeaf,
    A: LeafDataProvider,
    B: LeafDataProvider,
    C: LeafDataProvider,
    D: LeafDataProvider
[src]

LeafDataProvider implementation for (Tuple, ...)

This provides regular (non-compactable) composition of LeafDataProviders.

impl<A, B, C, D, E> LeafDataProvider for (A, B, C, D, E) where
    (A::LeafData, B::LeafData, C::LeafData, D::LeafData, E::LeafData): FullLeaf,
    A: LeafDataProvider,
    B: LeafDataProvider,
    C: LeafDataProvider,
    D: LeafDataProvider,
    E: LeafDataProvider
[src]

LeafDataProvider implementation for (Tuple, ...)

This provides regular (non-compactable) composition of LeafDataProviders.

Loading content...

Implementors

impl<H, A> LeafDataProvider for Compact<H, (A,)> where
    H: Hash,
    A: LeafDataProvider
[src]

LeafDataProvider implementation for Compact<H, (DataOrHash<H, Tuple>, ...)>

This provides a compact-form encoding for tuples wrapped in Compact.

impl<H, A, B> LeafDataProvider for Compact<H, (A, B)> where
    H: Hash,
    A: LeafDataProvider,
    B: LeafDataProvider
[src]

LeafDataProvider implementation for Compact<H, (DataOrHash<H, Tuple>, ...)>

This provides a compact-form encoding for tuples wrapped in Compact.

impl<H, A, B, C> LeafDataProvider for Compact<H, (A, B, C)> where
    H: Hash,
    A: LeafDataProvider,
    B: LeafDataProvider,
    C: LeafDataProvider
[src]

LeafDataProvider implementation for Compact<H, (DataOrHash<H, Tuple>, ...)>

This provides a compact-form encoding for tuples wrapped in Compact.

impl<H, A, B, C, D> LeafDataProvider for Compact<H, (A, B, C, D)> where
    H: Hash,
    A: LeafDataProvider,
    B: LeafDataProvider,
    C: LeafDataProvider,
    D: LeafDataProvider
[src]

LeafDataProvider implementation for Compact<H, (DataOrHash<H, Tuple>, ...)>

This provides a compact-form encoding for tuples wrapped in Compact.

impl<H, A, B, C, D, E> LeafDataProvider for Compact<H, (A, B, C, D, E)> where
    H: Hash,
    A: LeafDataProvider,
    B: LeafDataProvider,
    C: LeafDataProvider,
    D: LeafDataProvider,
    E: LeafDataProvider
[src]

LeafDataProvider implementation for Compact<H, (DataOrHash<H, Tuple>, ...)>

This provides a compact-form encoding for tuples wrapped in Compact.

Loading content...