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>)
| 154 | /// unit-tested without a global `IdentityStore`. See the intent list's |
| 155 | /// `compute_verifies` for the full rationale — identical rule, `verify_memory`. |
| 156 | fn compute_verifies(attested: &bridge::Attestation, verifier: Option<&Verifier>) -> Verifies { |
| 157 | let node = match attested { |
| 158 | bridge::Attestation::Fresh(node) => node, |
| 159 | bridge::Attestation::Stale(_) | bridge::Attestation::None => return Verifies::Na, |
| 160 | }; |
| 161 | let verifier = match verifier { |
| 162 | Some(v) => v, |
| 163 | None => return Verifies::Na, |
| 164 | }; |
| 165 | match node.attributed_to.as_deref() { |
| 166 | Some(signer) if signer == verifier.did => {} |
| 167 | _ => return Verifies::Na, |
| 168 | } |
| 169 | match atomic_canonical::verify_memory(node, &verifier.public_key) { |
| 170 | Ok(()) => Verifies::Yes, |
| 171 | Err(_) => Verifies::No, |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | /// The `(kind, status, about)` display columns for a memory. Prefers the attested |
| 176 | /// node when Fresh/Stale; falls back to a lenient lift of the raw memory when |
no test coverage detected