mirror of
https://github.com/mii443/merkle.rs.git
synced 2025-09-01 14:49:29 +00:00
Add dummy proof.rs file to avoid rustfmt failing
This commit is contained in:
20
src/proof.rs
20
src/proof.rs
@ -8,11 +8,17 @@ use tree::Tree;
|
|||||||
|
|
||||||
/// An inclusion proof represent the fact that a `value` is a member
|
/// An inclusion proof represent the fact that a `value` is a member
|
||||||
/// of a `MerkleTree` with root hash `root_hash`, and hash function `algorithm`.
|
/// of a `MerkleTree` with root hash `root_hash`, and hash function `algorithm`.
|
||||||
#[cfg_attr(feature = "serialization-serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(
|
||||||
|
feature = "serialization-serde",
|
||||||
|
derive(Serialize, Deserialize)
|
||||||
|
)]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Proof<T> {
|
pub struct Proof<T> {
|
||||||
/// The hashing algorithm used in the original `MerkleTree`
|
/// The hashing algorithm used in the original `MerkleTree`
|
||||||
#[cfg_attr(feature = "serialization-serde", serde(with = "algorithm_serde"))]
|
#[cfg_attr(
|
||||||
|
feature = "serialization-serde",
|
||||||
|
serde(with = "algorithm_serde")
|
||||||
|
)]
|
||||||
pub algorithm: &'static Algorithm,
|
pub algorithm: &'static Algorithm,
|
||||||
|
|
||||||
/// The hash of the root of the original `MerkleTree`
|
/// The hash of the root of the original `MerkleTree`
|
||||||
@ -151,7 +157,10 @@ impl<T> Proof<T> {
|
|||||||
/// A `Lemma` holds the hash of a node, the hash of its sibling node,
|
/// A `Lemma` holds the hash of a node, the hash of its sibling node,
|
||||||
/// and a sub lemma, whose `node_hash`, when combined with this `sibling_hash`
|
/// and a sub lemma, whose `node_hash`, when combined with this `sibling_hash`
|
||||||
/// must be equal to this `node_hash`.
|
/// must be equal to this `node_hash`.
|
||||||
#[cfg_attr(feature = "serialization-serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(
|
||||||
|
feature = "serialization-serde",
|
||||||
|
derive(Serialize, Deserialize)
|
||||||
|
)]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct Lemma {
|
pub struct Lemma {
|
||||||
pub node_hash: Vec<u8>,
|
pub node_hash: Vec<u8>,
|
||||||
@ -238,7 +247,10 @@ impl Lemma {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Tags a value so that we know from which branch of a `Tree` (if any) it was found.
|
/// Tags a value so that we know from which branch of a `Tree` (if any) it was found.
|
||||||
#[cfg_attr(feature = "serialization-serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(
|
||||||
|
feature = "serialization-serde",
|
||||||
|
derive(Serialize, Deserialize)
|
||||||
|
)]
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub enum Positioned<T> {
|
pub enum Positioned<T> {
|
||||||
/// The value was found in the left branch
|
/// The value was found in the left branch
|
||||||
|
Reference in New Issue
Block a user