From 4fc493e6d8cc20137f920f8647e39fc5051bb245 Mon Sep 17 00:00:00 2001 From: bndw Date: Sat, 14 Feb 2026 12:03:21 -0800 Subject: refactor: remove frivolous comments from auth validation/credentials Also removed internal/nostr package - now using northwest.io/nostr library. --- internal/nostr/kinds_test.go | 128 ------------------------------------------- 1 file changed, 128 deletions(-) delete mode 100644 internal/nostr/kinds_test.go (limited to 'internal/nostr/kinds_test.go') diff --git a/internal/nostr/kinds_test.go b/internal/nostr/kinds_test.go deleted file mode 100644 index 2bf013d..0000000 --- a/internal/nostr/kinds_test.go +++ /dev/null @@ -1,128 +0,0 @@ -package nostr - -import ( - "testing" -) - -func TestKindConstants(t *testing.T) { - // Verify constants match NIP-01 spec - tests := []struct { - name string - kind int - value int - }{ - {"Metadata", KindMetadata, 0}, - {"TextNote", KindTextNote, 1}, - {"ContactList", KindContactList, 3}, - {"EncryptedDM", KindEncryptedDM, 4}, - {"Deletion", KindDeletion, 5}, - {"Repost", KindRepost, 6}, - {"Reaction", KindReaction, 7}, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if tt.kind != tt.value { - t.Errorf("Kind%s = %d, want %d", tt.name, tt.kind, tt.value) - } - }) - } -} - -func TestIsRegular(t *testing.T) { - tests := []struct { - kind int - want bool - }{ - {0, false}, // Metadata - replaceable - {1, true}, // TextNote - regular - {3, false}, // ContactList - replaceable - {4, true}, // EncryptedDM - regular - {5, true}, // Deletion - regular - {1000, true}, // Regular range - {9999, true}, // Regular range - {10000, false}, // Replaceable range - {19999, false}, // Replaceable range - {20000, false}, // Ephemeral range - {29999, false}, // Ephemeral range - {30000, false}, // Addressable range - {39999, false}, // Addressable range - {40000, true}, // Back to regular - } - - for _, tt := range tests { - t.Run("kind_"+string(rune(tt.kind)), func(t *testing.T) { - if got := IsRegular(tt.kind); got != tt.want { - t.Errorf("IsRegular(%d) = %v, want %v", tt.kind, got, tt.want) - } - }) - } -} - -func TestIsReplaceable(t *testing.T) { - tests := []struct { - kind int - want bool - }{ - {0, true}, // Metadata - {1, false}, // TextNote - {3, true}, // ContactList - {10000, true}, // Replaceable range start - {15000, true}, // Replaceable range middle - {19999, true}, // Replaceable range end - {20000, false}, // Ephemeral range - {30000, false}, // Addressable range - } - - for _, tt := range tests { - t.Run("kind_"+string(rune(tt.kind)), func(t *testing.T) { - if got := IsReplaceable(tt.kind); got != tt.want { - t.Errorf("IsReplaceable(%d) = %v, want %v", tt.kind, got, tt.want) - } - }) - } -} - -func TestIsEphemeral(t *testing.T) { - tests := []struct { - kind int - want bool - }{ - {1, false}, // TextNote - {19999, false}, // Replaceable range - {20000, true}, // Ephemeral range start - {25000, true}, // Ephemeral range middle - {29999, true}, // Ephemeral range end - {30000, false}, // Addressable range - } - - for _, tt := range tests { - t.Run("kind_"+string(rune(tt.kind)), func(t *testing.T) { - if got := IsEphemeral(tt.kind); got != tt.want { - t.Errorf("IsEphemeral(%d) = %v, want %v", tt.kind, got, tt.want) - } - }) - } -} - -func TestIsAddressable(t *testing.T) { - tests := []struct { - kind int - want bool - }{ - {1, false}, // TextNote - {29999, false}, // Ephemeral range - {30000, true}, // Addressable range start - {35000, true}, // Addressable range middle - {39999, true}, // Addressable range end - {40000, false}, // Beyond addressable range - } - - for _, tt := range tests { - t.Run("kind_"+string(rune(tt.kind)), func(t *testing.T) { - if got := IsAddressable(tt.kind); got != tt.want { - t.Errorf("IsAddressable(%d) = %v, want %v", tt.kind, got, tt.want) - } - }) - } -} -- cgit v1.2.3