Skip to main content

verify_path

Function verify_path 

Source
pub fn verify_path(
    commit_id: &Hash,
    commit_bytes: &[u8],
    steps: &[Step],
) -> Result<PathVerified, VerifyError>
Expand description

Verify a path of Steps from a commit/remix’s tree_hash down to a leaf id, checking each step’s proof against the previous step’s child_id (the first against tree_hash itself).

commit_bytes MUST hash to commit_id and decode to a Commit or Remix — every other object kind has no tree_hash to walk from. Every non-final step MUST have mode == Tree. The returned path is the authenticated (name, mode) sequence; callers compare it against whatever path string they requested — this function never trusts one.

§Errors

See VerifyError’s variant docs for the specific failure reported.