Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
0xForerunner committed Mar 23, 2024
1 parent 866ec13 commit 594c717
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/dynamic_merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ impl<H: Hasher, S: DynamicTreeStorage<H>> DynamicMerkleTree<H, S> {

/// Returns an iterator over all leaves.
pub fn leaves(&self) -> impl Iterator<Item = H::Hash> + '_ {
// TODO this could be made faster by a custom iterator
(0..(1 << self.depth())).map(|i| self.get_leaf(i))
}
}
Expand Down Expand Up @@ -390,7 +389,7 @@ impl<H: Hasher> DynamicTreeStorage<H> for MmapVec<H> {
type StorageConfig = MmapTreeStorageConfig;

fn init(config: MmapTreeStorageConfig, vec: Vec<H::Hash>) -> Result<Self> {
Ok(Self::new(config.file_path, &vec)?)
Self::new(config.file_path, &vec)
}

fn reallocate(&mut self, empty_leaf: &H::Hash, sparse_column: &[H::Hash]) -> Result<()> {
Expand Down Expand Up @@ -924,7 +923,7 @@ mod tests {
file_path: PathBuf::from("target/tmp/test.mmap"),
};
let empty = 0;
let mut tree =
let tree =
DynamicMerkleTree::<TestHasher, MmapVec<_>>::restore(config, 10, &empty).unwrap();
debug_tree(&tree);
}
Expand Down

0 comments on commit 594c717

Please sign in to comment.