mirror of
https://github.com/tlsnotary/rs-merkle.git
synced 2026-01-09 06:48:04 -05:00
feat: Debug and Clone derives
This commit is contained in:
@@ -47,6 +47,7 @@ use core::convert::TryFrom;
|
|||||||
///
|
///
|
||||||
/// [`Hasher`]: crate::Hasher
|
/// [`Hasher`]: crate::Hasher
|
||||||
/// [`algorithms::Sha256`]: crate::algorithms::Sha256
|
/// [`algorithms::Sha256`]: crate::algorithms::Sha256
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||||
pub struct MerkleProof<H> {
|
pub struct MerkleProof<H> {
|
||||||
proof_hashes: Vec<H>,
|
proof_hashes: Vec<H>,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use crate::{
|
|||||||
/// Advanced features include being able to make transactional changes to a tree with being able to
|
/// Advanced features include being able to make transactional changes to a tree with being able to
|
||||||
/// roll back to any previously committed state of the tree. This scenario is similar to Git and
|
/// roll back to any previously committed state of the tree. This scenario is similar to Git and
|
||||||
/// can be found in databases and file systems.
|
/// can be found in databases and file systems.
|
||||||
#[derive(Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||||
pub struct MerkleTree<H> {
|
pub struct MerkleTree<H> {
|
||||||
current_working_tree: PartialTree<H>,
|
current_working_tree: PartialTree<H>,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ type PartialTreeLayer<H> = Vec<(usize, H)>;
|
|||||||
///
|
///
|
||||||
/// [`MerkleTree`]: crate::MerkleTree
|
/// [`MerkleTree`]: crate::MerkleTree
|
||||||
/// [`MerkleProof`]: crate::MerkleProof
|
/// [`MerkleProof`]: crate::MerkleProof
|
||||||
#[derive(Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||||
pub struct PartialTree<H> {
|
pub struct PartialTree<H> {
|
||||||
layers: Vec<Vec<(usize, H)>>,
|
layers: Vec<Vec<(usize, H)>>,
|
||||||
|
|||||||
Reference in New Issue
Block a user