Function tallytree::tally::pretty_print_tally[][src]

pub fn pretty_print_tally(node: &NodeRef, level: usize)
Expand description

Given a node in the merkle tally tree, prints the tree to stdout. Pass 0 for levelargument.

Leaf nodes are prefixed with their VoteReference. Parent nodes are prefixed with their hash.

Example:

use tallytree::generate::generate_tree;
use tallytree::tally::pretty_print_tally;
let tree = generate_tree(vec![
    ([0xaa; 32], vec![1, 0]),
    ([0xbb; 32], vec![0, 1]),
], false).unwrap();
pretty_print_tally(&tree, 0);