Function tallytree::node::is_null_node_ref[][src]

pub fn is_null_node_ref(node: &NodeRef) -> bool
Expand description

Checks if node is a ‘Ø-node’. A ‘Ø-node’ are dummy nodes used to balance the tree, so that all votes are at the same height in the tree.

Example:

use tallytree::node::is_null_node_ref;
use tallytree::generate::generate_tree;
let tree = generate_tree(vec![
    ([0xaa; 32], vec![1, 0]),
], false).unwrap();
assert!(is_null_node_ref(&tree.unwrap().right))