pub struct MerkleProof {
pub root_hash: Hash,
pub path: Vec<Node>,
}
Fields§
§root_hash: Hash
§path: Vec<Node>
Implementations§
Source§impl MerkleProof
impl MerkleProof
Sourcepub fn verify(&self) -> bool
pub fn verify(&self) -> bool
Verifies a Merkle proof against a given root hash.
This function takes a Merkle proof and verifies that the hashes in the proof’s path, when combined in the correct order, match the given root hash. It’s critical for ensuring the integrity and correctness of proofs in the (indexed) Merkle Tree.
§Returns
true
if the proof is valid and matches the root hash, false
otherwise.
Trait Implementations§
Source§impl Clone for MerkleProof
impl Clone for MerkleProof
Source§fn clone(&self) -> MerkleProof
fn clone(&self) -> MerkleProof
Returns a copy 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 moreSource§impl Debug for MerkleProof
impl Debug for MerkleProof
Source§impl<'de> Deserialize<'de> for MerkleProof
impl<'de> Deserialize<'de> for MerkleProof
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MerkleProof
impl RefUnwindSafe for MerkleProof
impl Send for MerkleProof
impl Sync for MerkleProof
impl Unpin for MerkleProof
impl UnwindSafe for MerkleProof
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