A wire Hash → the domain Merkle, refusing a malformed value.
(hash: &crate::atomic::Hash)
| 1072 | |
| 1073 | /// A wire Hash → the domain Merkle, refusing a malformed value. |
| 1074 | fn wire_hash(hash: &crate::atomic::Hash) -> Result<atomic_core::types::Merkle, Status> { |
| 1075 | let mut bytes = [0u8; 32]; |
| 1076 | if hash.value.len() != 32 { |
| 1077 | return Err(domain_status( |
| 1078 | ErrorCode::InvalidArgument, |
| 1079 | "hash must be 32 bytes", |
| 1080 | )); |
| 1081 | } |
| 1082 | bytes.copy_from_slice(&hash.value); |
| 1083 | Ok(atomic_core::types::Merkle(bytes)) |
| 1084 | } |
| 1085 | |
| 1086 | /// Resolve one raw change reference with the local insert bodies' |
| 1087 | /// semantics: a full base32 hash parses directly; otherwise a |
no test coverage detected