File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ impl<H: NodeHasher> SubTree<H> {
56
56
if self . is_empty ( ) {
57
57
return Ok ( H :: hash ( & [ ] ) ) ;
58
58
}
59
- Self :: hash_node ( & self . root , 0 )
59
+ Self :: hash_node ( & self . root )
60
60
}
61
61
62
62
#[ inline( always) ]
@@ -197,7 +197,7 @@ impl<H: NodeHasher> SubTree<H> {
197
197
}
198
198
}
199
199
200
- fn hash_node ( node : & SubTreeNode , depth : usize ) -> Result < Hash , VerifyError > {
200
+ fn hash_node ( node : & SubTreeNode ) -> Result < Hash , VerifyError > {
201
201
match node {
202
202
SubTreeNode :: Leaf { key, value_or_hash } => match value_or_hash {
203
203
ValueOrHash :: Value ( value) => {
@@ -211,9 +211,8 @@ impl<H: NodeHasher> SubTree<H> {
211
211
left,
212
212
right,
213
213
} => {
214
- let depth = depth + prefix. bit_len ( ) + 1 ;
215
- let left_hash = Self :: hash_node ( left, depth) ?;
216
- let right_hash = Self :: hash_node ( right, depth) ?;
214
+ let left_hash = Self :: hash_node ( left) ?;
215
+ let right_hash = Self :: hash_node ( right) ?;
217
216
Ok ( H :: hash_internal ( prefix. as_bytes ( ) , & left_hash, & right_hash) )
218
217
}
219
218
SubTreeNode :: Hash ( hash) => Ok ( hash. clone ( ) ) ,
You can’t perform that action at this time.
0 commit comments