The DID-match-then-verify rule for a memory. Pure over its inputs so it can be unit-tested without a global `IdentityStore`. See the intent list's `compute_verifies` for the full rationale — identical rule, `verify_memory`.
(attested: &bridge::Attestation, verifier: Option<&Verifier>)
| 228 | /// unit-tested without a global `IdentityStore`. See the intent list's |
| 229 | /// `compute_verifies` for the full rationale — identical rule, `verify_memory`. |
| 230 | fn compute_verifies(attested: &bridge::Attestation, verifier: Option<&Verifier>) -> Verifies { |
| 231 | let node = match attested { |
| 232 | bridge::Attestation::Fresh(node) => node, |
| 233 | bridge::Attestation::Stale(_) | bridge::Attestation::None => return Verifies::Na, |
| 234 | }; |
| 235 | let verifier = match verifier { |
| 236 | Some(v) => v, |
| 237 | None => return Verifies::Na, |
| 238 | }; |
| 239 | match node.attributed_to.as_deref() { |
| 240 | Some(signer) if signer == verifier.did => {} |
| 241 | _ => return Verifies::Na, |
| 242 | } |
| 243 | match atomic_canonical::verify_memory(node, &verifier.public_key) { |
| 244 | Ok(()) => Verifies::Yes, |
| 245 | Err(_) => Verifies::No, |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | /// The `(kind, status, about)` display columns for a memory. Prefers the attested |
| 250 | /// node when Fresh/Stale; falls back to a lenient lift of the raw memory when |
no test coverage detected