[][src]Struct grin_core::core::merkle_proof::MerkleProof

pub struct MerkleProof {
    pub mmr_size: u64,
    pub path: Vec<Hash>,
}

A Merkle proof that proves a particular element exists in the MMR.

Fields

mmr_size: u64

The size of the MMR at the time the proof was created.

path: Vec<Hash>

The sibling path from the leaf up to the final sibling hashing to the root.

Methods

impl MerkleProof[src]

pub fn empty() -> MerkleProof[src]

The "empty" Merkle proof.

pub fn to_hex(&self) -> String[src]

Serialize the Merkle proof as a hex string (for api json endpoints)

pub fn from_hex(hex: &str) -> Result<MerkleProof, String>[src]

Convert hex string representation back to a Merkle proof instance

pub fn verify(
    &self,
    root: Hash,
    element: &dyn PMMRIndexHashable,
    node_pos: u64
) -> Result<(), MerkleProofError>
[src]

Verifies the Merkle proof against the provided root hash, element and position in the MMR.

Trait Implementations

impl Writeable for MerkleProof[src]

impl Readable for MerkleProof[src]

impl PartialOrd<MerkleProof> for MerkleProof[src]

impl PartialEq<MerkleProof> for MerkleProof[src]

impl Ord for MerkleProof[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Eq for MerkleProof[src]

impl Default for MerkleProof[src]

impl Clone for MerkleProof[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for MerkleProof[src]

impl Serialize for MerkleProof[src]

impl<'de> Deserialize<'de> for MerkleProof[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T