error aware Keyer.GetPublicKey

This commit is contained in:
1l0
2024-09-19 17:47:18 +09:00
committed by fiatjaf_
parent e1cdb71d6f
commit 0b2b69529b
6 changed files with 35 additions and 17 deletions

View File

@@ -17,11 +17,14 @@ func NewBunkerSignerFromBunkerClient(bc *nip46.BunkerClient) BunkerSigner {
return BunkerSigner{bc}
}
func (bs BunkerSigner) GetPublicKey(ctx context.Context) string {
func (bs BunkerSigner) GetPublicKey(ctx context.Context) (string, error) {
ctx, cancel := context.WithTimeout(ctx, time.Second*30)
defer cancel()
pk, _ := bs.bunker.GetPublicKey(ctx)
return pk
pk, err := bs.bunker.GetPublicKey(ctx)
if err != nil {
return "", err
}
return pk, nil
}
func (bs BunkerSigner) SignEvent(ctx context.Context, evt *nostr.Event) error {