Skip to content

Commit

Permalink
Undo changes in 0960300
Browse files Browse the repository at this point in the history
  • Loading branch information
autquis committed Oct 22, 2024
1 parent 6d026d6 commit 87cc830
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 1 addition & 5 deletions crypto-primitives/src/merkle_tree/constraints.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
crh::{CRHSchemeGadget, TwoToOneCRHSchemeGadget},
merkle_tree::{Config, Path},
merkle_tree::{Config, IdentityDigestConverter, Path},
};
use ark_ff::PrimeField;
use ark_r1cs_std::prelude::*;
Expand All @@ -9,15 +9,11 @@ use ark_relations::r1cs::{Namespace, SynthesisError};
use ark_std::vec::Vec;
use ark_std::{borrow::Borrow, fmt::Debug};

#[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: 0 additions & 2 deletions crypto-primitives/src/merkle_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ 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 87cc830

Please sign in to comment.