Trait pallet_mmr_primitives::LeafDataProvider[][src]

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

A provider of the MMR’s leaf data.

Associated Types

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

Required methods

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 pallet at the very beginning of each block.

Implementations on Foreign Types

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 frame_system::Pallet. 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.

LeafDataProvider implementation for (Tuple, ...)

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

LeafDataProvider implementation for (Tuple, ...)

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

LeafDataProvider implementation for (Tuple, ...)

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

LeafDataProvider implementation for (Tuple, ...)

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

LeafDataProvider implementation for (Tuple, ...)

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

Implementors