diff --git a/crypto-primitives/src/merkle_tree/constraints.rs b/crypto-primitives/src/merkle_tree/constraints.rs index aa9fbb8..ccad3a9 100644 --- a/crypto-primitives/src/merkle_tree/constraints.rs +++ b/crypto-primitives/src/merkle_tree/constraints.rs @@ -1,5 +1,5 @@ use crate::crh::TwoToOneCRHSchemeGadget; -use crate::merkle_tree::{Config, IdentityDigestConverter}; +use crate::merkle_tree::Config; use crate::{crh::CRHSchemeGadget, merkle_tree::Path}; use ark_ff::PrimeField; use ark_r1cs_std::prelude::*; @@ -9,11 +9,15 @@ use ark_std::fmt::Debug; #[cfg(not(feature = "std"))] use ark_std::vec::Vec; +#[cfg(test)] +use crate::merkle_tree::IdentityDigestConverter; + pub trait DigestVarConverter { type TargetType: Borrow; fn convert(from: From) -> Result; } +#[cfg(test)] impl DigestVarConverter for IdentityDigestConverter { type TargetType = T; diff --git a/crypto-primitives/src/merkle_tree/mod.rs b/crypto-primitives/src/merkle_tree/mod.rs index 5a7e493..14b9671 100644 --- a/crypto-primitives/src/merkle_tree/mod.rs +++ b/crypto-primitives/src/merkle_tree/mod.rs @@ -49,10 +49,12 @@ pub trait DigestConverter { } /// A trivial converter where digest of previous layer's hash is the same as next layer's input. +#[cfg(test)] pub struct IdentityDigestConverter { _prev_layer_digest: T, } +#[cfg(test)] impl DigestConverter for IdentityDigestConverter { type TargetType = T; fn convert(item: T) -> Result {