Recursively compute the root hash.
(&self)
| 104 | |
| 105 | /// Recursively compute the root hash. |
| 106 | pub fn root(&self) -> Address { |
| 107 | match self { |
| 108 | AssumptionTree::Leaf(addr) => leaf_hash(addr), |
| 109 | AssumptionTree::Padding => zero_address(), |
| 110 | AssumptionTree::Node(l, r) => node_hash(&l.root(), &r.root()), |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | /// In-order traversal of real leaves (skips `Padding`). |
| 115 | pub fn leaves(&self) -> Vec<Address> { |