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

Function test_hash_deterministic

atomic-core/src/change/attestation.rs:1014–1022  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1012
1013 #[test]
1014 fn test_hash_deterministic() {
1015 let a = make_attestation();
1016 let bytes1 = a.serialize().unwrap();
1017 let bytes2 = a.serialize().unwrap();
1018
1019 let (_, hash1) = Attestation::deserialize(&bytes1).unwrap();
1020 let (_, hash2) = Attestation::deserialize(&bytes2).unwrap();
1021 assert_eq!(hash1, hash2);
1022 }
1023
1024 #[test]
1025 fn test_different_content_different_hash() {

Callers

nothing calls this directly

Calls 4

make_attestationFunction · 0.85
deserializeFunction · 0.85
unwrapMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected