An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(identity-wallet): update tests for serde_json::Value and ChangeType enum

- Updated test data to use serde_json::json\!() for signed_op values
- Changed verified_signed_op test data from String to serde_json::Value
- Fixed OpDiff prev_cid to use Option<String> (Some/None) in tests
- Updated ServiceChange test to use ChangeType::Modified enum instead of string

authored by

Malpercio and committed by
Tangled
b24d5dac 0004a815

+14 -10
+14 -10
apps/identity-wallet/src-tauri/src/claim.rs
··· 1309 1309 added_keys: vec!["did:key:zQ3new".to_string()], 1310 1310 removed_keys: vec![], 1311 1311 changed_services: vec![], 1312 - prev_cid: "bagXXX".to_string(), 1312 + prev_cid: Some("bagXXX".to_string()), 1313 1313 }, 1314 - signed_op: "eyJzaWciOiAi...".to_string(), 1314 + signed_op: serde_json::json!({"sig": "..."}), 1315 1315 warnings: vec!["This will change ownership".to_string()], 1316 1316 }; 1317 1317 1318 1318 let json = serde_json::to_value(&op).unwrap(); 1319 - assert_eq!(json["signedOp"], "eyJzaWciOiAi..."); 1319 + assert!(json["signedOp"].is_object()); 1320 1320 assert!(json["diff"].is_object()); 1321 1321 assert_eq!(json["warnings"][0], "This will change ownership"); 1322 1322 } ··· 1327 1327 added_keys: vec!["did:key:zQ3new".to_string()], 1328 1328 removed_keys: vec!["did:key:zQ3old".to_string()], 1329 1329 changed_services: vec![], 1330 - prev_cid: "bagXXX".to_string(), 1330 + prev_cid: Some("bagXXX".to_string()), 1331 1331 }; 1332 1332 1333 1333 let json = serde_json::to_value(&diff).unwrap(); ··· 1341 1341 fn test_service_change_serializes_camel_case() { 1342 1342 let change = ServiceChange { 1343 1343 id: "atproto_pds".to_string(), 1344 - change_type: "modified".to_string(), 1344 + change_type: ChangeType::Modified, 1345 1345 old_endpoint: Some("https://pds-old.example.com".to_string()), 1346 1346 new_endpoint: Some("https://pds-new.example.com".to_string()), 1347 1347 }; ··· 2450 2450 services: std::collections::HashMap::new(), 2451 2451 }, 2452 2452 pds_oauth_client: None, 2453 - verified_signed_op: Some( 2454 - r#"{"type":"plc_operation","prev":"bafy123","rotationKeys":["did:key:zQ3test"]}"# 2455 - .to_string(), 2456 - ), 2453 + verified_signed_op: Some(serde_json::json!({ 2454 + "type": "plc_operation", 2455 + "prev": "bafy123", 2456 + "rotationKeys": ["did:key:zQ3test"] 2457 + })), 2457 2458 }; 2458 2459 2459 2460 let result = submit_claim_impl(&pds_client, &claim_state).await; ··· 2493 2494 services: std::collections::HashMap::new(), 2494 2495 }, 2495 2496 pds_oauth_client: None, 2496 - verified_signed_op: Some(r#"{"type":"plc_operation","prev":"bafy123"}"#.to_string()), 2497 + verified_signed_op: Some(serde_json::json!({ 2498 + "type": "plc_operation", 2499 + "prev": "bafy123" 2500 + })), 2497 2501 }; 2498 2502 2499 2503 let result = submit_claim_impl(&pds_client, &claim_state).await;