Struct nmt_rs::simple_merkle::proof::Proof
source · pub struct Proof<M: MerkleHash> {
pub siblings: Vec<M::Output>,
pub range: Range<u32>,
}Expand description
A proof of some statement about a namespaced merkle tree.
This proof may prove the presence of some set of leaves, or the absence of a particular namespace
Fields§
§siblings: Vec<M::Output>The siblings to be used to build the path to the root.
range: Range<u32>The range of indices covered by the proof.
Implementations§
source§impl<M> Proof<M>where
M: MerkleHash + Default,
impl<M> Proof<M>where
M: MerkleHash + Default,
sourcepub fn verify_range(
&self,
root: &M::Output,
leaf_hashes: &[M::Output],
) -> Result<(), RangeProofError>
pub fn verify_range( &self, root: &M::Output, leaf_hashes: &[M::Output], ) -> Result<(), RangeProofError>
Verify a range proof
source§impl<M> Proof<M>where
M: MerkleHash,
impl<M> Proof<M>where
M: MerkleHash,
sourcepub fn verify_range_with_hasher(
&self,
root: &M::Output,
leaf_hashes: &[M::Output],
hasher: M,
) -> Result<(), RangeProofError>
pub fn verify_range_with_hasher( &self, root: &M::Output, leaf_hashes: &[M::Output], hasher: M, ) -> Result<(), RangeProofError>
Verify a range proof
sourcepub fn leftmost_right_sibling(&self) -> Option<&M::Output>
pub fn leftmost_right_sibling(&self) -> Option<&M::Output>
Returns the leftmost node to the right of the proven range, if one exists.
sourcepub fn rightmost_left_sibling(&self) -> Option<&M::Output>
pub fn rightmost_left_sibling(&self) -> Option<&M::Output>
Returns the rightmost node to the left of the proven range, if one exists.
Trait Implementations§
source§impl<M: MerkleHash> Default for Proof<M>
impl<M: MerkleHash> Default for Proof<M>
impl<M: MerkleHash> StructuralPartialEq for Proof<M>
Auto Trait Implementations§
impl<M> Freeze for Proof<M>
impl<M> RefUnwindSafe for Proof<M>
impl<M> Send for Proof<M>
impl<M> Sync for Proof<M>
impl<M> Unpin for Proof<M>
impl<M> UnwindSafe for Proof<M>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)