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

Function hash_domain

libatomic/src/daemon/services_provenance.rs:249–258  ·  view source on GitHub ↗
(hash: &Option<crate::atomic::Hash>)

Source from the content-addressed store, hash-verified

247}
248
249fn 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
260fn checkpoint_source_domain(source: &CheckpointSource) -> ProvenanceCheckpointSource {
261 ProvenanceCheckpointSource {

Callers 2

Calls 3

domain_statusFunction · 0.85
as_refMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected