feat(kind): using constants

This commit is contained in:
Isaque Veras
2023-09-06 21:00:05 -03:00
committed by fiatjaf_
parent eef7c40dc7
commit 0f66883dc7
12 changed files with 38 additions and 35 deletions

View File

@ -112,7 +112,7 @@ func TestEncodeNprofile(t *testing.T) {
func TestEncodeDecodeNaddr(t *testing.T) {
naddr, err := EncodeEntity(
"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
30023,
nostr.KindArticle,
"banana",
[]string{
"wss://relay.nostr.example.mydomain.example.com",
@ -136,7 +136,7 @@ func TestEncodeDecodeNaddr(t *testing.T) {
if ep.PublicKey != "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d" {
t.Error("returned wrong pubkey")
}
if ep.Kind != 30023 {
if ep.Kind != nostr.KindArticle {
t.Error("returned wrong kind")
}
if ep.Identifier != "banana" {
@ -159,7 +159,7 @@ func TestDecodeNaddrWithoutRelays(t *testing.T) {
if ep.PublicKey != "7fa56f5d6962ab1e3cd424e758c3002b8665f7b0d8dcee9fe9e288d7751ac194" {
t.Error("returned wrong pubkey")
}
if ep.Kind != 30023 {
if ep.Kind != nostr.KindArticle {
t.Error("returned wrong kind")
}
if ep.Identifier != "references" {