(attempt: &StoreAttempt)
| 221 | } |
| 222 | |
| 223 | fn 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 | |
| 249 | fn hash_domain(hash: &Option<crate::atomic::Hash>) -> Result<Hash, Status> { |
| 250 | let hash = hash |
no test coverage detected