MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / verify

Function verify

libatomic/src/review/view_comparison.rs:393–411  ·  view source on GitHub ↗
(repo: &Repository, comparison: &ViewComparison)

Source from the content-addressed store, hash-verified

391}
392
393pub(super) fn verify(repo: &Repository, comparison: &ViewComparison) -> CliResult<()> {
394 comparison.conformance.verify(repo)?;
395 for pin in [&comparison.from, &comparison.to] {
396 if repo
397 .get_view_info(&pin.view)
398 .map_err(CliError::Repository)?
399 .state
400 .to_base32()
401 != pin.state
402 || super::graph::membership_hash(repo, &pin.view)? != pin.membership_hash
403 {
404 return Err(invalid(format!(
405 "Recorded comparison view '{}' changed during audit/export; retry both views",
406 pin.view
407 )));
408 }
409 }
410 Ok(())
411}
412
413#[cfg(test)]
414mod tests {

Calls 5

membership_hashFunction · 0.85
get_view_infoMethod · 0.80
invalidFunction · 0.70
verifyMethod · 0.45
to_base32Method · 0.45