Enum miden_processor::MerkleSet
source · pub enum MerkleSet {
MerkleTree(MerkleTree),
SparseMerkleTree(SimpleSmt),
MerklePathSet(MerklePathSet),
}
Expand description
TODO: add docs
Variants§
Implementations§
source§impl MerkleSet
impl MerkleSet
sourcepub fn new_merkle_tree(leaves: Vec<Word>) -> Result<Self, MerkleError>
pub fn new_merkle_tree(leaves: Vec<Word>) -> Result<Self, MerkleError>
Returns a new MerkleSet instantiated as a Merkle tree from the provided leaves.
For more information, check [MerkleTree::new]
.
sourcepub fn new_sparse_merkle_tree(
keys: Vec<u64>,
values: Vec<Word>,
depth: u8
) -> Result<Self, MerkleError>
pub fn new_sparse_merkle_tree( keys: Vec<u64>, values: Vec<Word>, depth: u8 ) -> Result<Self, MerkleError>
Returns a new MerkleSet instantiated as a Sparse Merkle tree from the provided leaves.
For more information, check [SimpleSmt::new]
.
sourcepub fn get_node(&self, index: NodeIndex) -> Result<Word, MerkleError>
pub fn get_node(&self, index: NodeIndex) -> Result<Word, MerkleError>
Returns a node located at the specified index.
For more information, check the following concrete implementations:
[MerkleTree::get_node]
[SimpleSmt::get_node]
[MerklePathSet::get_node]
sourcepub fn get_path(&self, index: NodeIndex) -> Result<MerklePath, MerkleError>
pub fn get_path(&self, index: NodeIndex) -> Result<MerklePath, MerkleError>
Returns a Merkle path to a node located at the specified index. The node itself is not included in the path.
For more information, check the following concrete implementations:
[MerkleTree::get_path]
[SimpleSmt::get_path]
[MerklePathSet::get_path]
sourcepub fn update_leaf(&mut self, index: u64, value: Word) -> Result<(), MerkleError>
pub fn update_leaf(&mut self, index: u64, value: Word) -> Result<(), MerkleError>
Replaces the leaf at the specified index with the provided value.
For more information, check the following concrete implementations:
[MerkleTree::update_leaf]
[SimpleSmt::update_leaf]
[MerklePathSet::update_leaf]