| 391 | } |
| 392 | |
| 393 | pub(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)] |
| 414 | mod tests { |