Function
hash_domain
(hash: &Option<pb::Hash>)
Source from the content-addressed store, hash-verified
| 301 | } |
| 302 | |
| 303 | fn hash_domain(hash: &Option<pb::Hash>) -> anyhow::Result<Hash> { |
| 304 | let bytes: [u8; 32] = hash |
| 305 | .as_ref() |
| 306 | .ok_or_else(|| anyhow!("hash missing in response"))? |
| 307 | .value |
| 308 | .clone() |
| 309 | .try_into() |
| 310 | .map_err(|_| anyhow!("hash is not 32 bytes"))?; |
| 311 | Ok(Hash::from_bytes(bytes)) |
| 312 | } |
| 313 | |
| 314 | fn checkpoint_source_proto(source: &JournalCheckpointSource) -> pb::CheckpointSource { |
| 315 | pb::CheckpointSource { |
Callers
nothing calls this directly
Tested by
no test coverage detected