pub struct SparseCompactMerkleProof<H> { /* private fields */ }
Expand description
SparseCompactMerkleProof is a compact Merkle proof for an element in a SparseMerkleTree.
Implementations§
Source§impl<H> SparseCompactMerkleProof<H>
impl<H> SparseCompactMerkleProof<H>
Sourcepub fn new(
side_nodes: Vec<Bytes>,
non_membership_leaf_data: Option<Bytes>,
bitmask: Bytes,
num_side_nodes: usize,
sibling_data: Option<Bytes>,
) -> Self
pub fn new( side_nodes: Vec<Bytes>, non_membership_leaf_data: Option<Bytes>, bitmask: Bytes, num_side_nodes: usize, sibling_data: Option<Bytes>, ) -> Self
Creates a new SparseCompactMerkleProof.
Sourcepub fn sibling_data(&self) -> Option<&Bytes>
pub fn sibling_data(&self) -> Option<&Bytes>
Get the sibility of for this proof
Sourcepub fn non_membership_leaf_data(&self) -> Option<&Bytes>
pub fn non_membership_leaf_data(&self) -> Option<&Bytes>
Get the non-membership leaf data for this proof
Sourcepub fn original_side_nodes_len(&self) -> usize
pub fn original_side_nodes_len(&self) -> usize
Get the original number of side nodes
Sourcepub fn side_nodes(&self) -> &[Bytes]
pub fn side_nodes(&self) -> &[Bytes]
Get the side nodes for this compacted proof
Source§impl<H: Digest> SparseCompactMerkleProof<H>
impl<H: Digest> SparseCompactMerkleProof<H>
Sourcepub fn verify(
&self,
root: impl AsRef<[u8]>,
key: impl AsRef<[u8]>,
value: impl AsRef<[u8]>,
) -> bool
pub fn verify( &self, root: impl AsRef<[u8]>, key: impl AsRef<[u8]>, value: impl AsRef<[u8]>, ) -> bool
Verifies a Merkle proof
Sourcepub fn decompact(&self) -> Result<SparseMerkleProof<H>, BadProof>
pub fn decompact(&self) -> Result<SparseMerkleProof<H>, BadProof>
Decompacts a proof, so that it can be used for verify
Sourcepub fn decompact_into(self) -> Result<SparseMerkleProof<H>, BadProof>
pub fn decompact_into(self) -> Result<SparseMerkleProof<H>, BadProof>
Decompacts a proof, so that it can be used for verify
Trait Implementations§
Source§impl<H: Clone> Clone for SparseCompactMerkleProof<H>
impl<H: Clone> Clone for SparseCompactMerkleProof<H>
Source§fn clone(&self) -> SparseCompactMerkleProof<H>
fn clone(&self) -> SparseCompactMerkleProof<H>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<H> !Freeze for SparseCompactMerkleProof<H>
impl<H> RefUnwindSafe for SparseCompactMerkleProof<H>where
H: RefUnwindSafe,
impl<H> Send for SparseCompactMerkleProof<H>where
H: Send,
impl<H> Sync for SparseCompactMerkleProof<H>where
H: Sync,
impl<H> Unpin for SparseCompactMerkleProof<H>where
H: Unpin,
impl<H> UnwindSafe for SparseCompactMerkleProof<H>where
H: UnwindSafe,
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