Skip to main content

verify_hash_chain

Function verify_hash_chain 

pub fn verify_hash_chain<I>(
    events: I,
    encoding: &dyn JournalEncoding,
) -> Result<(), JournalError>
Expand description

Verify the record-level blake3 hash chain across a sequence of events.

Every event must carry a record_hash. For each event:

  1. Recomputes the hash (encode with record_hash set to None, then blake3).
  2. Compares with the stored record_hashRecordHashMismatch on mismatch.
  3. Verifies prev_record_hash matches the previous event’s record_hashHashChainBreak on mismatch.