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

Function test_signed_data_json_roundtrip

atomic-identity/src/signing.rs:601–610  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

599
600 #[test]
601 fn test_signed_data_json_roundtrip() {
602 let keypair = KeyPair::generate();
603 let signed = SignedData::sign(b"test data".to_vec(), &keypair);
604
605 let json = serde_json::to_string(&signed).unwrap();
606 let recovered: SignedData = serde_json::from_str(&json).unwrap();
607
608 assert_eq!(signed, recovered);
609 assert!(recovered.verify(&keypair.public).is_ok());
610 }
611
612 #[test]
613 fn test_signature_info_json_roundtrip() {

Callers

nothing calls this directly

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected