upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/http
diff options
context:
space:
mode:
Diffstat (limited to 'src/http')
-rw-r--r--src/http/nip11.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/http/nip11.rs b/src/http/nip11.rs
index 7c58175..f7af3c2 100644
--- a/src/http/nip11.rs
+++ b/src/http/nip11.rs
@@ -100,7 +100,7 @@ impl RelayInformationDocument {
100 Self { 100 Self {
101 name: config.relay_name(), 101 name: config.relay_name(),
102 description: config.relay_description.clone(), 102 description: config.relay_description.clone(),
103 pubkey: config.relay_owner_npub().ok(), 103 pubkey: config.relay_owner_pubkey_hex().ok(),
104 contact: None, // Could be added to config if needed 104 contact: None, // Could be added to config if needed
105 supported_nips: vec![ 105 supported_nips: vec![
106 1, // NIP-01: Basic protocol flow 106 1, // NIP-01: Basic protocol flow
@@ -145,10 +145,11 @@ mod tests {
145 assert_eq!(doc.name, "Test Relay"); 145 assert_eq!(doc.name, "Test Relay");
146 assert_eq!(doc.description, "A test relay"); 146 assert_eq!(doc.description, "A test relay");
147 147
148 // Verify pubkey is present and is a valid npub 148 // Verify pubkey is present and is a valid hex string (64 chars)
149 assert!(doc.pubkey.is_some()); 149 assert!(doc.pubkey.is_some());
150 let pubkey = doc.pubkey.unwrap(); 150 let pubkey = doc.pubkey.unwrap();
151 assert!(pubkey.starts_with("npub1")); 151 assert_eq!(pubkey.len(), 64);
152 assert!(pubkey.chars().all(|c| c.is_ascii_hexdigit()));
152 153
153 assert!(doc.supported_nips.contains(&1)); 154 assert!(doc.supported_nips.contains(&1));
154 assert!(doc.supported_nips.contains(&11)); 155 assert!(doc.supported_nips.contains(&11));