mirror of
https://github.com/vacp2p/pmtree.git
synced 2026-01-09 15:28:02 -05:00
fix: update recalculate_from function
This commit is contained in:
@@ -134,7 +134,7 @@ where
|
||||
let mut i = key;
|
||||
|
||||
while depth != 0 {
|
||||
let value = self.hash_couple(depth, key);
|
||||
let value = self.hash_couple(depth, i);
|
||||
i >>= 1;
|
||||
depth -= 1;
|
||||
self.db.put(Key(depth, i).into(), value.into());
|
||||
|
||||
@@ -59,10 +59,4 @@ impl Hasher for MyKeccak {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn insert_delete() {
|
||||
let mt = MerkleTree::<MemoryDB, MyKeccak>::new(3, "abacaba");
|
||||
|
||||
assert_eq!(mt.capacity(), 8);
|
||||
assert_eq!(mt.depth(), 3);
|
||||
println!("{:?}", mt.root());
|
||||
}
|
||||
fn insert_delete() {}
|
||||
|
||||
Reference in New Issue
Block a user