go-nostr/count_test.go

27 lines
511 B
Go
Raw Normal View History

2023-07-18 16:17:00 -03:00
package nostr
import (
"context"
"testing"
)
func TestCount(t *testing.T) {
const RELAY = "wss://relay.nostr.band"
rl := mustRelayConnect(RELAY)
defer rl.Close()
count, err := rl.Count(context.Background(), Filters{
2023-09-06 21:00:05 -03:00
{Kinds: []int{KindContactList}, Tags: TagMap{"p": []string{"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"}}},
2023-07-18 16:17:00 -03:00
})
if err != nil {
t.Errorf("count request failed: %v", err)
return
}
if count <= 0 {
t.Errorf("count result wrong: %v", count)
return
}
}