//! Local verification of a cell witness against a state root.

use ontoref_commit::{BinaryMerkle, CommitmentBackend, StateRoot, Witness};

/// Verify a [`Witness`] against the foreign ontology's [`StateRoot`].
///
/// Pure function — does not consult any external state. Delegates to
/// [`BinaryMerkle::verify_witness`] (currently the only registered
/// [`CommitmentBackend`] impl). When alternative backends are wired in,
/// this function will dispatch over the registry entry's backend tag.
pub fn verify_cell(witness: &Witness, state_root: &StateRoot) -> bool {
    BinaryMerkle::verify_witness(witness, state_root)
}
