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

Function attempt_proto

libatomic/src/daemon/services_provenance.rs:223–247  ·  view source on GitHub ↗
(attempt: &StoreAttempt)

Source from the content-addressed store, hash-verified

221}
222
223fn attempt_proto(attempt: &StoreAttempt) -> ProvenanceCheckpointAttempt {
224 use crate::atomic::CheckpointPhase as PbPhase;
225 let phase = match attempt.phase {
226 ProvenanceCheckpointPhase::Prepared => PbPhase::Prepared,
227 ProvenanceCheckpointPhase::HashBound => PbPhase::HashBound,
228 ProvenanceCheckpointPhase::Published => PbPhase::Published,
229 };
230 ProvenanceCheckpointAttempt {
231 attempt_generation: attempt.attempt_generation,
232 frozen_event_count: attempt.frozen_event_count,
233 source: Some(checkpoint_source_proto(&attempt.source)),
234 phase: phase as i32,
235 provenance_hash: attempt.provenance_hash.as_ref().map(hash_proto),
236 session_turn: attempt
237 .session_turn
238 .as_ref()
239 .map(|turn| crate::atomic::SessionTurn {
240 session_id: turn.session_id.clone(),
241 turn_number: turn.turn_number,
242 }),
243 manifest_hash: attempt.manifest_hash.as_ref().map(hash_proto),
244 prepared_at: Some(timestamp(attempt.prepared_at)),
245 updated_at: Some(timestamp(attempt.updated_at)),
246 }
247}
248
249fn hash_domain(hash: &Option<crate::atomic::Hash>) -> Result<Hash, Status> {
250 let hash = hash

Callers 2

prepare_checkpoint_implFunction · 0.85

Calls 4

as_refMethod · 0.80
checkpoint_source_protoFunction · 0.70
timestampFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected