fix nip05.

This commit is contained in:
fiatjaf
2024-03-11 13:44:58 -03:00
parent c844dc2ccb
commit 7284ebcf13
2 changed files with 14 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package nip05
import (
"context"
"testing"
)
@@ -35,3 +36,15 @@ func TestParse(t *testing.T) {
t.Fatalf("should have errored")
}
}
func TestQuery(t *testing.T) {
pp, err := QueryIdentifier(context.Background(), "fiatjaf.com")
if err != nil || pp.PublicKey != "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d" {
t.Fatalf("invalid query for fiatjaf.com")
}
pp, err = QueryIdentifier(context.Background(), "htlc@fiatjaf.com")
if err != nil || pp.PublicKey != "f9dd6a762506260b38a2d3e5b464213c2e47fa3877429fe9ee60e071a31a07d7" {
t.Fatalf("invalid query for htlc@fiatjaf.com")
}
}