pub fn verify_proofs(
        &self,
        hasher: &dyn HashTree,
        old_root_hash: ValueHash,
        instructions: &[TreeInstruction],
    ) -> anyhow::Result<()> {
        ensure!(instructions.len() == self.logs.len());

        let mut root_hash = old_root_hash;
        for (op, &instruction) in self.logs.iter().zip(instructions) {
            ensure!(op.merkle_path.len() <= TREE_DEPTH);
            if matches!(instruction, TreeInstruction::Read(_)) {
                ensure!(
                    op.root_hash == root_hash,
                    "Condition failed: `op.root_hash == root_hash` ({:?} vs {:?})",
                    op.root_hash,
                    root_hash
                );
                ensure!(op.base.is_read());
            } else {
                ensure!(!op.base.is_read());
            }

            let prev_entry = match op.base {
                TreeLogEntry::Inserted | TreeLogEntry::ReadMissingKey => {
                    TreeEntry::empty(instruction.key())
                }
                TreeLogEntry::Updated {
                    leaf_index,
                    previous_value: value,
                }
                | TreeLogEntry::Read { leaf_index, value } => {
                    TreeEntry::new(instruction.key(), leaf_index, value)
                }
            };

            let prev_hash = hasher.fold_merkle_path(&op.merkle_path, prev_entry);
            ensure!(
                prev_hash == root_hash,
                "Condition failed: `prev_hash == root_hash` ({:?} vs {:?})",
                prev_hash,
                root_hash
            );
            if let TreeInstruction::Write(new_entry) = instruction {
                let next_hash = hasher.fold_merkle_path(&op.merkle_path, new_entry);
                ensure!(
                    next_hash == op.root_hash,
                    "Condition failed: `next_hash == op.root_hash` ({:?} vs {:?})",
                    next_hash,
                    op.root_hash
                );
            }
            root_hash = op.root_hash;
        }
        Ok(())
    }
Verifies this output against the trusted old root hash of the tree and
the applied instructions.

# Errors

As the errors are not actionable, a string error with the failing condition is returned.
core/lib/merkle_tree/src/hasher/proofs.rs