pub fn verify_chain(receipts: &[Payload]) -> Result<ChainReport>Expand description
Verifies a slice of receipts as one contiguous chain.
This checks only the chain-level relationships between adjacent receipts.
It does NOT re-verify any receipt’s own chain.hash against its content.
Payload::from_json already did that at parse time, for every receipt in
the slice.
Rules, applied in this order:
- An empty slice is rejected.
- The head of the presentation (
receipts[0]) MUST carryseq == 0andprevHash == None. Per-receipt validation already enforces the seq0/prevHash-null pairing in general; this is the additional chain-level rule that the head of a presentation specifically must be sequence zero. - For each adjacent pair,
seqMUST be contiguous:seq[i] == seq[i-1] + 1. - For each adjacent pair,
prevHash[i]MUST equalSome(hash[i-1]). - A change in
issuerAffiliationbetween adjacent receipts is recorded in the returnedChainReportand does NOT invalidate the presentation. See the module documentation for why this one is not a rejection.
§Errors
Returns Error::Validation on the first structural rule violated, in the
order listed above.