mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-07-01 11:02:47 +02:00
feat(kind): using constants
This commit is contained in:
@ -15,7 +15,7 @@ func TestSubscribe(t *testing.T) {
|
||||
rl := mustRelayConnect(RELAY)
|
||||
defer rl.Close()
|
||||
|
||||
sub, err := rl.Subscribe(context.Background(), Filters{{Kinds: []int{1}, Limit: 2}})
|
||||
sub, err := rl.Subscribe(context.Background(), Filters{{Kinds: []int{KindTextNote}, Limit: 2}})
|
||||
if err != nil {
|
||||
t.Errorf("subscription failed: %v", err)
|
||||
return
|
||||
@ -56,7 +56,7 @@ func TestNestedSubscriptions(t *testing.T) {
|
||||
n := atomic.Uint32{}
|
||||
|
||||
// fetch 2 replies to a note
|
||||
sub, err := rl.Subscribe(context.Background(), Filters{{Kinds: []int{1}, Tags: TagMap{"e": []string{"0e34a74f8547e3b95d52a2543719b109fd0312aba144e2ef95cba043f42fe8c5"}}, Limit: 3}})
|
||||
sub, err := rl.Subscribe(context.Background(), Filters{{Kinds: []int{KindTextNote}, Tags: TagMap{"e": []string{"0e34a74f8547e3b95d52a2543719b109fd0312aba144e2ef95cba043f42fe8c5"}}, Limit: 3}})
|
||||
if err != nil {
|
||||
t.Errorf("subscription 1 failed: %v", err)
|
||||
return
|
||||
@ -66,7 +66,7 @@ func TestNestedSubscriptions(t *testing.T) {
|
||||
select {
|
||||
case event := <-sub.Events:
|
||||
// now fetch author of this
|
||||
sub, err := rl.Subscribe(context.Background(), Filters{{Kinds: []int{0}, Authors: []string{event.PubKey}, Limit: 1}})
|
||||
sub, err := rl.Subscribe(context.Background(), Filters{{Kinds: []int{KindSetMetadata}, Authors: []string{event.PubKey}, Limit: 1}})
|
||||
if err != nil {
|
||||
t.Errorf("subscription 2 failed: %v", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user