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