Compute one memory's row. A read/lift/attestation failure for a SINGLE memory degrades that row's computed columns to `–`/0 rather than aborting the list.
(repo: &Repository, id: &str, verifier: Option<&Verifier>)
| 228 | /// Compute one memory's row. A read/lift/attestation failure for a SINGLE memory |
| 229 | /// degrades that row's computed columns to `–`/0 rather than aborting the list. |
| 230 | fn compute_row(repo: &Repository, id: &str, verifier: Option<&Verifier>) -> Row { |
| 231 | let inputs = match bridge::read_memory(repo, id) { |
| 232 | Ok(i) => i, |
| 233 | Err(_) => { |
| 234 | return Row { |
| 235 | id: id.to_string(), |
| 236 | kind: NA.to_string(), |
| 237 | status: NA.to_string(), |
| 238 | about: 0, |
| 239 | attested: Attested::None, |
| 240 | verifies: Verifies::Na, |
| 241 | } |
| 242 | } |
| 243 | }; |
| 244 | let attestation = bridge::load_attestation(repo, id, &inputs); |
| 245 | let (attested, verifies, node_owned) = match attestation { |
| 246 | Ok(a) => { |
| 247 | let verifies = compute_verifies(&a, verifier); |
| 248 | (classify(&a), verifies, Some(a)) |
| 249 | } |
| 250 | Err(_) => (Attested::None, Verifies::Na, None), |
| 251 | }; |
| 252 | let node = node_owned.as_ref().and_then(attested_node); |
| 253 | let (kind, status, about) = kind_status_about(node, &inputs); |
| 254 | Row { |
| 255 | id: id.to_string(), |
| 256 | kind, |
| 257 | status, |
| 258 | about, |
| 259 | attested, |
| 260 | verifies, |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | impl Command for MemoryList { |
| 265 | fn run(&self) -> CliResult<()> { |
no test coverage detected