mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-03 19:49:46 +02:00
fix nip05.
This commit is contained in:
parent
c844dc2ccb
commit
7284ebcf13
@ -84,7 +84,7 @@ func Fetch(ctx context.Context, fullname string) (resp WellKnownResponse, name s
|
||||
return resp, name, fmt.Errorf("failed to decode json response: %w", err)
|
||||
}
|
||||
|
||||
return resp, name, nil
|
||||
return result, name, nil
|
||||
}
|
||||
|
||||
func NormalizeIdentifier(fullname string) string {
|
||||
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user