Struct commit_verify::lnpbp4::MerkleProof
source · [−]pub struct MerkleProof { /* private fields */ }Expand description
A proof of the merkle commitment.
Implementations
sourceimpl MerkleProof
impl MerkleProof
sourcepub fn pos(&self) -> u16
pub fn pos(&self) -> u16
Method returning copy of MerkleProof::pos field.
Position of the leaf in the tree.
sourceimpl MerkleProof
impl MerkleProof
sourcepub fn into_path(self) -> Vec<MerkleNode>
pub fn into_path(self) -> Vec<MerkleNode>
Converts the proof into inner merkle path representation
sourcepub fn to_path(&self) -> Vec<MerkleNode>
pub fn to_path(&self) -> Vec<MerkleNode>
Constructs the proof into inner merkle path representation
sourcepub fn as_path(&self) -> &[MerkleNode]
pub fn as_path(&self) -> &[MerkleNode]
Returns inner merkle path representation
sourcepub fn verify(
&self,
protocol_id: ProtocolId,
message: Message,
commitment: CommitmentHash
) -> bool
pub fn verify(
&self,
protocol_id: ProtocolId,
message: Message,
commitment: CommitmentHash
) -> bool
Verifies that the given proof is a valid proof for the commitment to
the message under the given protocol_id.
Trait Implementations
sourceimpl Clone for MerkleProof
impl Clone for MerkleProof
sourcefn clone(&self) -> MerkleProof
fn clone(&self) -> MerkleProof
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for MerkleProof
impl Debug for MerkleProof
sourceimpl Default for MerkleProof
impl Default for MerkleProof
sourcefn default() -> MerkleProof
fn default() -> MerkleProof
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for MerkleProof
impl<'de> Deserialize<'de> for MerkleProof
sourcefn 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
sourceimpl Hash for MerkleProof
impl Hash for MerkleProof
sourceimpl Ord for MerkleProof
impl Ord for MerkleProof
sourceimpl PartialEq<MerkleProof> for MerkleProof
impl PartialEq<MerkleProof> for MerkleProof
sourcefn eq(&self, other: &MerkleProof) -> bool
fn eq(&self, other: &MerkleProof) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &MerkleProof) -> bool
fn ne(&self, other: &MerkleProof) -> bool
This method tests for !=.
sourceimpl PartialOrd<MerkleProof> for MerkleProof
impl PartialOrd<MerkleProof> for MerkleProof
sourcefn partial_cmp(&self, other: &MerkleProof) -> Option<Ordering>
fn partial_cmp(&self, other: &MerkleProof) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl Serialize for MerkleProof
impl Serialize for MerkleProof
sourceimpl StrictDecode for MerkleProof
impl StrictDecode for MerkleProof
sourcefn strict_decode<D: Read>(d: D) -> Result<Self, Error>
fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
Decode with the given std::io::Read instance; must either
construct an instance or return implementation-specific error type. Read more
sourcefn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
Tries to deserialize byte array into the current type using
StrictDecode::strict_decode Read more
sourceimpl StrictEncode for MerkleProof
impl StrictEncode for MerkleProof
sourcefn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
Encode with the given std::io::Write instance; must return result
with either amount of bytes encoded – or implementation-specific
error type. Read more
sourcefn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
Serializes data as a byte array using StrictEncode::strict_encode
function Read more
impl Eq for MerkleProof
impl Proof for MerkleProof
impl StructuralEq for MerkleProof
impl StructuralPartialEq for MerkleProof
Auto Trait Implementations
impl RefUnwindSafe for MerkleProof
impl Send for MerkleProof
impl Sync for MerkleProof
impl Unpin for MerkleProof
impl UnwindSafe for MerkleProof
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.