From 2b9b4dfa2f4c79766878557322b73c554a8a841a Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 1 Dec 2023 20:50:00 -0300 Subject: [PATCH] nip46: rename Pool to Signer. --- nip46/signer.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nip46/signer.go b/nip46/signer.go index 2220d6e..2031940 100644 --- a/nip46/signer.go +++ b/nip46/signer.go @@ -75,7 +75,7 @@ func (s Session) MakeResponse( return resp, evt, nil } -type Pool struct { +type Signer struct { secretKey string sessionKeys []string @@ -89,15 +89,15 @@ type relayReadWrite struct { Write bool `json:"write"` } -func NewPool(secretKey string) Pool { - return Pool{secretKey: secretKey} +func NewSigner(secretKey string) Signer { + return Signer{secretKey: secretKey} } -func (p *Pool) AddRelay(url string, read bool, write bool) { +func (p *Signer) AddRelay(url string, read bool, write bool) { p.RelaysToAdvertise[url] = relayReadWrite{read, write} } -func (p *Pool) GetSession(clientPubkey string) (Session, error) { +func (p *Signer) GetSession(clientPubkey string) (Session, error) { idx, exists := slices.BinarySearch(p.sessionKeys, clientPubkey) if exists { return p.sessions[idx], nil @@ -123,7 +123,7 @@ func (p *Pool) GetSession(clientPubkey string) (Session, error) { return session, nil } -func (p *Pool) HandleRequest(event *nostr.Event) (req Request, resp Response, eventResponse nostr.Event, harmless bool, err error) { +func (p *Signer) HandleRequest(event *nostr.Event) (req Request, resp Response, eventResponse nostr.Event, harmless bool, err error) { if event.Kind != nostr.KindNostrConnect { return req, resp, eventResponse, false, fmt.Errorf("event kind is %d, but we expected %d", event.Kind, nostr.KindNostrConnect)