pub struct MerkleBlock { /* private fields */ }
Expand description

Partially-concealed merkle tree data.

Implementations

Method returning copy of MerkleBlock::depth field. Tree depth (up to 16).

Method returning copy of MerkleBlock::entropy field. Entropy used for placeholders. May be unknown if the message is not

Constructs merkle block from a merkle proof

Conceals all commitments in the block except for the commitment under given protocol_ids. Also removes information about the entropy value used.

Returns

Number of concealed nodes.

Error

If leaf with the given protocol_id is not found (absent or already concealed), errors with LeafNotKnown error.

Merges information from the given proof to the merkle block, revealing path related to te commitment to the message under the given protocol_id.

Merges two merkle blocks together, joining revealed information from each one of them.

Converts the merkle block into a merkle proof for the inclusion of a commitment under given protocol_id.

Constructs merkle proof for the inclusion of a commitment under given protocol_id for the current Merkle block.

Computes position for a given protocol_id within the tree leaves.

Computes the width of the merkle tree.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Reduces merkle tree into merkle tree root.

The resulting confidential type concealing and committing to the original data Read more

Encodes the data for the commitment by writing them directly into a io::Write writer instance Read more

Serializes data for the commitment in-memory into a newly allocated array Read more

Type of the resulting commitment

Performs commitment to client-side-validated data

Verifies commitment to client-side-validated data

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

Decode with the given std::io::Read instance; must either construct an instance or return implementation-specific error type. Read more

Tries to deserialize byte array into the current type using StrictDecode::strict_decode Read more

Encode with the given std::io::Write instance; must return result with either amount of bytes encoded – or implementation-specific error type. Read more

Serializes data as a byte array using StrictEncode::strict_encode function Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Verifies commit-equivalence of two instances of the same type.