pub struct SparseMerkleTreeWithHistoryBounded<'a, L: Serialize + DeserializeOwned + Clone + Debug + PartialEq + PrimaryKey<'a>, H: Hasher<L>, const HISTORY_LEVEL: u32> {
    pub history_index: Item<'a, u32>,
    pub root_history: Map<'a, L, Empty>,
    pub root_index: Map<'a, u32, L>,
    pub tree: SparseMerkleTree<'a, L, H>,
}
Expand description

Like SparseMerkleTree but able to check valid root hash with previous root hashes upto specified history level.

Fields

history_index: Item<'a, u32>root_history: Map<'a, L, Empty>root_index: Map<'a, u32, L>tree: SparseMerkleTree<'a, L, H>

Implementations

Remove storage unused and out of range stored root. The removed root might not be the earliest.

Trait Implementations

Initize the tree.
Check if the root is valid for the tree.
Insert the leaf into the next index slot of the tree. Return the leaf’s index and the updated root. Read more
Get the latest root of the tree.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.