One resolved attestation's detail (schema "atomic.attestation.detail.v1"): the domain payload plus the per-view coverage rows (in the view listing's order, zero-total views skipped), so the client renders the detail with the same code the local body runs.
(
repo: &Repository,
hash: &atomic_core::types::Hash,
attest: &Attestation,
)
| 2932 | /// listing's order, zero-total views skipped), so the client renders the |
| 2933 | /// detail with the same code the local body runs. |
| 2934 | fn attestation_detail_bundle( |
| 2935 | repo: &Repository, |
| 2936 | hash: &atomic_core::types::Hash, |
| 2937 | attest: &Attestation, |
| 2938 | ) -> Result<VersionedBytes, Status> { |
| 2939 | let mut coverage: Vec<Value> = Vec::new(); |
| 2940 | if let Ok(views) = repo.list_views() { |
| 2941 | for view_name in &views { |
| 2942 | let Ok(history) = |
| 2943 | repo.log(atomic_repository::history::HistoryOptions::default().view(view_name)) |
| 2944 | else { |
| 2945 | continue; |
| 2946 | }; |
| 2947 | let total = history.len(); |
| 2948 | if total == 0 { |
| 2949 | continue; |
| 2950 | } |
| 2951 | let covered = history |
| 2952 | .iter() |
| 2953 | .filter(|entry| attest.covers_change(&entry.hash)) |
| 2954 | .count(); |
| 2955 | coverage.push(serde_json::json!({ |
| 2956 | "view": view_name, |
| 2957 | "covered": covered, |
| 2958 | "total": total, |
| 2959 | })); |
| 2960 | } |
| 2961 | } |
| 2962 | let payload = serde_json::json!({ |
| 2963 | "hash": hash.to_base32(), |
| 2964 | "attestation": attest, |
| 2965 | "coverage": coverage, |
| 2966 | }); |
| 2967 | serde_json::to_vec(&payload) |
| 2968 | .map(|payload| VersionedBytes { |
| 2969 | schema: "atomic.attestation.detail.v1".to_string(), |
| 2970 | payload, |
| 2971 | }) |
| 2972 | .map_err(|error| Status::internal(error.to_string())) |
| 2973 | } |
| 2974 | |
| 2975 | pub struct AttestationImpl { |
| 2976 | pub state: Arc<DaemonState>, |
no test coverage detected