Trait noble_mmr_primitives::LeafDataProvider [−][src]
A provider of the MMR’s leaf data.
Associated Types
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.
Implementations on Foreign Types
impl LeafDataProvider for ()
[src]
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)
fn leaf_data() -> Self::LeafData
[src]
impl<A> LeafDataProvider for (A,) where
(A::LeafData,): FullLeaf,
A: LeafDataProvider,
[src]
(A::LeafData,): FullLeaf,
A: LeafDataProvider,
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]
(A::LeafData, B::LeafData): FullLeaf,
A: LeafDataProvider,
B: LeafDataProvider,
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]
(A::LeafData, B::LeafData, C::LeafData): FullLeaf,
A: LeafDataProvider,
B: LeafDataProvider,
C: LeafDataProvider,
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]
(A::LeafData, B::LeafData, C::LeafData, D::LeafData): FullLeaf,
A: LeafDataProvider,
B: LeafDataProvider,
C: LeafDataProvider,
D: LeafDataProvider,
LeafDataProvider implementation for (Tuple, ...)
This provides regular (non-compactable) composition of LeafDataProviders.
type LeafData = (A::LeafData, B::LeafData, C::LeafData, D::LeafData)
fn leaf_data() -> Self::LeafData
[src]
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]
(A::LeafData, B::LeafData, C::LeafData, D::LeafData, E::LeafData): FullLeaf,
A: LeafDataProvider,
B: LeafDataProvider,
C: LeafDataProvider,
D: LeafDataProvider,
E: LeafDataProvider,
LeafDataProvider implementation for (Tuple, ...)
This provides regular (non-compactable) composition of LeafDataProviders.
type LeafData = (A::LeafData, B::LeafData, C::LeafData, D::LeafData, E::LeafData)
fn leaf_data() -> Self::LeafData
[src]
Implementors
impl<H, A> LeafDataProvider for Compact<H, (A,)> where
H: Hash,
A: LeafDataProvider,
[src]
H: Hash,
A: LeafDataProvider,
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]
H: Hash,
A: LeafDataProvider,
B: LeafDataProvider,
LeafDataProvider implementation for Compact<H, (DataOrHash<H, Tuple>, ...)>
This provides a compact-form encoding for tuples wrapped in Compact.
type LeafData = Compact<H, (DataOrHash<H, A::LeafData>, DataOrHash<H, B::LeafData>)>
fn leaf_data() -> Self::LeafData
[src]
impl<H, A, B, C> LeafDataProvider for Compact<H, (A, B, C)> where
H: Hash,
A: LeafDataProvider,
B: LeafDataProvider,
C: LeafDataProvider,
[src]
H: Hash,
A: LeafDataProvider,
B: LeafDataProvider,
C: LeafDataProvider,
LeafDataProvider implementation for Compact<H, (DataOrHash<H, Tuple>, ...)>
This provides a compact-form encoding for tuples wrapped in Compact.
type LeafData = Compact<H, (DataOrHash<H, A::LeafData>, DataOrHash<H, B::LeafData>, DataOrHash<H, C::LeafData>)>
fn leaf_data() -> Self::LeafData
[src]
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]
H: Hash,
A: LeafDataProvider,
B: LeafDataProvider,
C: LeafDataProvider,
D: LeafDataProvider,
LeafDataProvider implementation for Compact<H, (DataOrHash<H, Tuple>, ...)>
This provides a compact-form encoding for tuples wrapped in Compact.
type LeafData = Compact<H, (DataOrHash<H, A::LeafData>, DataOrHash<H, B::LeafData>, DataOrHash<H, C::LeafData>, DataOrHash<H, D::LeafData>)>
fn leaf_data() -> Self::LeafData
[src]
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]
H: Hash,
A: LeafDataProvider,
B: LeafDataProvider,
C: LeafDataProvider,
D: LeafDataProvider,
E: LeafDataProvider,
LeafDataProvider implementation for Compact<H, (DataOrHash<H, Tuple>, ...)>
This provides a compact-form encoding for tuples wrapped in Compact.