(&mut self, leaf: [u8; 32])
| 21 | } |
| 22 | |
| 23 | pub fn append(&mut self, leaf: [u8; 32]) { |
| 24 | let mut current = leaf; |
| 25 | let mut size = self.size; |
| 26 | while size % 2 == 1 { |
| 27 | let sibling = self.subroots.pop().unwrap(); |
| 28 | current = hash_pair(sibling, current); |
| 29 | size /= 2 |
| 30 | } |
| 31 | self.subroots.push(current); |
| 32 | self.size += 1; |
| 33 | } |
| 34 | |
| 35 | /// Verifies an inclusion proof against the current MMR root |
| 36 | pub fn verify_proof(&self, leaf: [u8; 32], mmr_proof: &MMRInclusionProof) -> bool { |