feat(nip11): advertise GRASP-02 support in relay info

Add GRASP-02 to supported_grasps array in NIP-11 relay information
document to advertise proactive sync capability to clients and tools.
This commit is contained in:
DanConwayDev
2026-01-12 15:11:12 +00:00
parent 5148479d76
commit f62f3e0109
+5 -3
View File
@@ -74,8 +74,8 @@ impl RelayInformationDocument {
},
icon: Some(format!("https://{}/icon.png", config.domain)),
// GRASP-01 Extensions
supported_grasps: vec!["GRASP-01".to_string()],
// GRASP Extensions
supported_grasps: vec!["GRASP-01".to_string(), "GRASP-02".to_string()],
repo_acceptance_criteria: "None".to_string(),
curation: None, // Not a curated relay - only SPAM prevention via GRASP-01 policy
}
@@ -112,7 +112,7 @@ mod tests {
assert!(doc.supported_nips.contains(&11));
assert!(doc.supported_nips.contains(&34));
assert!(doc.supported_nips.contains(&77));
assert_eq!(doc.supported_grasps, vec!["GRASP-01"]);
assert_eq!(doc.supported_grasps, vec!["GRASP-01", "GRASP-02"]);
assert!(doc.repo_acceptance_criteria.contains("None"));
assert!(doc.curation.is_none());
assert_eq!(
@@ -138,11 +138,13 @@ mod tests {
assert!(json.contains("\"supported_grasps\""));
assert!(json.contains("\"repo_acceptance_criteria\""));
assert!(json.contains("GRASP-01"));
assert!(json.contains("GRASP-02"));
// Verify it's valid JSON by parsing
let parsed: serde_json::Value = serde_json::from_str(&json).expect("Invalid JSON");
assert_eq!(parsed["name"], "Test Relay");
assert_eq!(parsed["supported_grasps"][0], "GRASP-01");
assert_eq!(parsed["supported_grasps"][1], "GRASP-02");
assert_eq!(parsed["icon"], "https://relay.example.com/icon.png");
}
}