(hash: &Option<crate::atomic::Hash>)
| 247 | } |
| 248 | |
| 249 | fn hash_domain(hash: &Option<crate::atomic::Hash>) -> Result<Hash, Status> { |
| 250 | let hash = hash |
| 251 | .as_ref() |
| 252 | .ok_or_else(|| domain_status(ErrorCode::InvalidArgument, "hash is required"))?; |
| 253 | let bytes: [u8; 32] = |
| 254 | hash.value.clone().try_into().map_err(|_| { |
| 255 | domain_status(ErrorCode::InvalidArgument, "hash must be exactly 32 bytes") |
| 256 | })?; |
| 257 | Ok(Hash::from_bytes(bytes)) |
| 258 | } |
| 259 | |
| 260 | fn checkpoint_source_domain(source: &CheckpointSource) -> ProvenanceCheckpointSource { |
| 261 | ProvenanceCheckpointSource { |
no test coverage detected