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

Function test_hash_deterministic

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

Source from the content-addressed store, hash-verified

1533
1534 #[test]
1535 fn test_hash_deterministic() {
1536 let a = make_attestation();
1537 let bytes1 = a.serialize().unwrap();
1538 let bytes2 = a.serialize().unwrap();
1539
1540 let (_, hash1) = Attestation::deserialize(&bytes1).unwrap();
1541 let (_, hash2) = Attestation::deserialize(&bytes2).unwrap();
1542 assert_eq!(hash1, hash2);
1543 }
1544
1545 #[test]
1546 fn test_different_content_different_hash() {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected