modify update_sapling_tree utility to output JSON

This commit is contained in:
Kevin Gorham 2019-02-21 10:52:44 -05:00
parent 148563b7e6
commit 2c4a48b772
1 changed files with 5 additions and 4 deletions

View File

@ -26,10 +26,11 @@ const BATCH_SIZE: u64 = 10_000;
fn print_sapling_tree(height: u64, time: u32, tree: CommitmentTree) {
let mut tree_bytes = vec![];
tree.write(&mut tree_bytes).unwrap();
println!("Updated Sapling tree:");
println!("- Height: {}", height);
println!("- Time: {}", time);
println!("- Tree: {}", hex::encode(tree_bytes));
println!("{");
println!(" \"height\": {},", height);
println!(" \"time\": {},", time);
println!(" \"tree\": \"{}\",", hex::encode(tree_bytes));
println!("}");
}
fn main() {