refactor: flattened repo structure

This commit is contained in:
Bobbin Threadbare
2022-10-26 14:54:38 -07:00
parent 2f3dcd47e3
commit 7395697a68
11 changed files with 33 additions and 34 deletions

29
src/merkle/mod.rs Normal file
View File

@@ -0,0 +1,29 @@
use crate::Word;
#[cfg(test)]
use crate::{Felt, ZERO};
pub mod merkle_path_set;
pub mod merkle_tree;
// ERRORS
// ================================================================================================
#[derive(Clone, Debug)]
pub enum MerkleError {
DepthTooSmall,
DepthTooBig(u32),
NumLeavesNotPowerOfTwo(usize),
InvalidIndex(u32, u64),
InvalidDepth(u32, u32),
InvalidPath(Vec<Word>),
NodeNotInSet(u64),
}
// HELPER FUNCTIONS
// ================================================================================================
#[cfg(test)]
const fn int_to_node(value: u64) -> Word {
[Felt::new(value), ZERO, ZERO, ZERO]
}