Correct Sapling outputs parsing
This commit is contained in:
parent
a6a69ae4cc
commit
697ce83f7c
1 changed files with 15 additions and 8 deletions
|
@ -445,15 +445,22 @@ pub extern "C" fn rust_wrapper_tx_parse(
|
||||||
let parsed_tx = Transaction::read(&mut tx_reader, Nu5);
|
let parsed_tx = Transaction::read(&mut tx_reader, Nu5);
|
||||||
match parsed_tx {
|
match parsed_tx {
|
||||||
Ok(t) => {
|
Ok(t) => {
|
||||||
let s_bundle = t.sapling_bundle().unwrap().shielded_outputs();
|
let s_bundle = t.sapling_bundle();
|
||||||
|
match s_bundle {
|
||||||
|
Some(b) => {
|
||||||
let mut s_output = Vec::new();
|
let mut s_output = Vec::new();
|
||||||
for s_each_out in s_bundle.iter() {
|
for s_each_out in b.shielded_outputs().iter() {
|
||||||
let mut out_bytes = Vec::new();
|
let mut out_bytes = Vec::new();
|
||||||
let _ = s_each_out.write_v4(&mut out_bytes);
|
let _ = s_each_out.write_v4(&mut out_bytes);
|
||||||
s_output.push(out_bytes);
|
s_output.push(out_bytes);
|
||||||
}
|
}
|
||||||
marshall_to_haskell_var(&s_output, out, out_len, RW);
|
marshall_to_haskell_var(&s_output, out, out_len, RW);
|
||||||
//TODO: write array of bytes
|
},
|
||||||
|
None => {
|
||||||
|
let z = HrawTx { bytes: vec![0], s: false, o: false};
|
||||||
|
marshall_to_haskell_var(&z, out, out_len, RW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
Err(_e) => {
|
Err(_e) => {
|
||||||
|
|
Loading…
Reference in a new issue