pub struct MerkleTree { /* private fields */ }Expand description
Merkle tree for computing state roots
Implementations§
Source§impl MerkleTree
impl MerkleTree
Sourcepub fn generate_proof(
&mut self,
leaf_index: usize,
) -> Option<Vec<([u8; 32], bool)>>
pub fn generate_proof( &mut self, leaf_index: usize, ) -> Option<Vec<([u8; 32], bool)>>
Generate a Merkle inclusion proof for the leaf at the given index.
Returns a vector of sibling hashes from leaf to root. Each entry is
(sibling_hash, is_left) where is_left indicates the sibling is on the
left side of the pair.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MerkleTree
impl RefUnwindSafe for MerkleTree
impl Send for MerkleTree
impl Sync for MerkleTree
impl Unpin for MerkleTree
impl UnsafeUnpin for MerkleTree
impl UnwindSafe for MerkleTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more