Skip to content

Commit

Permalink
Fix nightly check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesar199999 committed Jun 28, 2024
1 parent 12796fd commit 0960300
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crypto-primitives/src/merkle_tree/constraints.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand All @@ -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<From, To: ?Sized> {
type TargetType: Borrow<To>;
fn convert(from: From) -> Result<Self::TargetType, SynthesisError>;
}

#[cfg(test)]
impl<T> DigestVarConverter<T, T> for IdentityDigestConverter<T> {
type TargetType = T;

Expand Down
2 changes: 2 additions & 0 deletions crypto-primitives/src/merkle_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ pub trait DigestConverter<From, To: ?Sized> {
}

/// A trivial converter where digest of previous layer's hash is the same as next layer's input.
#[cfg(test)]
pub struct IdentityDigestConverter<T> {
_prev_layer_digest: T,
}

#[cfg(test)]
impl<T> DigestConverter<T, T> for IdentityDigestConverter<T> {
type TargetType = T;
fn convert(item: T) -> Result<T, Error> {
Expand Down

0 comments on commit 0960300

Please sign in to comment.