MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / compute_row

Function compute_row

atomic-cli/src/commands/memory/list.rs:230–262  ·  view source on GitHub ↗

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>)

Source from the content-addressed store, hash-verified

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.
230fn 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
264impl Command for MemoryList {
265 fn run(&self) -> CliResult<()> {

Callers 2

runMethod · 0.70
row_forFunction · 0.70

Calls 6

read_memoryFunction · 0.85
kind_status_aboutFunction · 0.85
as_refMethod · 0.80
load_attestationFunction · 0.70
compute_verifiesFunction · 0.70
classifyFunction · 0.70

Tested by

no test coverage detected