fix(rust): account for empty leaf in sapling path
This commit is contained in:
parent
8244ffa1ce
commit
20851a4e48
1 changed files with 6 additions and 1 deletions
|
@ -1694,7 +1694,12 @@ pub extern "C" fn rust_wrapper_read_sapling_path_anchor(
|
|||
){
|
||||
let path_in: Hpath = marshall_from_haskell_var(path, path_len, RW);
|
||||
let cmx_in: Vec<u8> = marshall_from_haskell_var(cmx, cmx_len, RW);
|
||||
let mk_path = sapling_crypto::MerklePath::from_parts(path_in.path.iter().map(|x| Node::from_bytes(to_array(x.bytes.clone())).unwrap()).collect(), Position::from(u64::from(path_in.position)));
|
||||
let mk_path = sapling_crypto::MerklePath::from_parts(path_in.path.iter().map(|x|
|
||||
if x.bytes.len() > 1 {
|
||||
Node::from_bytes(to_array(x.bytes.clone())).unwrap()
|
||||
} else {
|
||||
Node::empty_leaf()
|
||||
}).collect(), Position::from(u64::from(path_in.position)));
|
||||
match mk_path {
|
||||
Ok(mp1) => {
|
||||
let nc = SaplingNoteCommitment::from_bytes(&to_array(cmx_in));
|
||||
|
|
Loading…
Reference in a new issue