Functions to create and manage Orchard commitment trees #99
1 changed files with 2 additions and 2 deletions
|
@ -1538,8 +1538,8 @@ pub extern "C" fn rust_wrapper_read_orchard_tree_anchor(
|
||||||
){
|
){
|
||||||
let tree_in: Hfrontier = marshall_from_haskell_var(tree, tree_len, RW);
|
let tree_in: Hfrontier = marshall_from_haskell_var(tree, tree_len, RW);
|
||||||
let leaf = MerkleHashOrchard::from_bytes(&to_array(tree_in.leaf.bytes)).unwrap();
|
let leaf = MerkleHashOrchard::from_bytes(&to_array(tree_in.leaf.bytes)).unwrap();
|
||||||
let comm_tree: NonEmptyFrontier<MerkleHashOrchard> = NonEmptyFrontier::from_parts(Position::from(tree_in.position), leaf, tree_in.ommers.iter().map(|x| MerkleHashOrchard::from_bytes(&to_array(x.bytes.clone())).unwrap() ).collect()).unwrap();
|
let comm_tree: Frontier<MerkleHashOrchard,32> = Frontier::from_parts(Position::from(tree_in.position), leaf, tree_in.ommers.iter().map(|x| MerkleHashOrchard::from_bytes(&to_array(x.bytes.clone())).unwrap() ).collect()).unwrap();
|
||||||
let root = comm_tree.root(None);
|
let root = comm_tree.root();
|
||||||
let h = Hhex { bytes: root.to_bytes().to_vec() };
|
let h = Hhex { bytes: root.to_bytes().to_vec() };
|
||||||
marshall_to_haskell_var(&h, out, out_len, RW);
|
marshall_to_haskell_var(&h, out, out_len, RW);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue