From bce95327d444ee0eac9bc3b55c38a29cf76f7cf7 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 6 Feb 2025 15:02:49 -0300 Subject: [PATCH] nip60: expose ParseKeysetKeys() --- nip60/helpers.go | 2 +- nip60/lightning-swap.go | 2 +- nip60/pay.go | 2 +- nip60/swap.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nip60/helpers.go b/nip60/helpers.go index 55ca84a..a30ca0f 100644 --- a/nip60/helpers.go +++ b/nip60/helpers.go @@ -184,7 +184,7 @@ func unblindSignature(C_str string, r *secp256k1.PrivateKey, key *secp256k1.Publ return Cstr, nil } -func parseKeysetKeys(keys nut01.KeysMap) (map[uint64]*btcec.PublicKey, error) { +func ParseKeysetKeys(keys nut01.KeysMap) (map[uint64]*btcec.PublicKey, error) { parsedKeys := make(map[uint64]*btcec.PublicKey) for amount, pkh := range keys { pkb, err := hex.DecodeString(pkh) diff --git a/nip60/lightning-swap.go b/nip60/lightning-swap.go index c68cf06..c052634 100644 --- a/nip60/lightning-swap.go +++ b/nip60/lightning-swap.go @@ -134,7 +134,7 @@ func redeemMinted( } // unblind the signatures from the promises and build the blinded messages - keysetKeys, err := parseKeysetKeys(keyset.Keys) + keysetKeys, err := ParseKeysetKeys(keyset.Keys) if err != nil { return nil, fmt.Errorf("target mint %s sent us an invalid keyset: %w", mint, err) } diff --git a/nip60/pay.go b/nip60/pay.go index 626c1bb..002cb90 100644 --- a/nip60/pay.go +++ b/nip60/pay.go @@ -79,7 +79,7 @@ meltworked: if err != nil { return "", fmt.Errorf("failed to get active keyset for %s: %w", chosen.mint, err) } - ksKeys, err := parseKeysetKeys(activeKeyset.Keys) + ksKeys, err := ParseKeysetKeys(activeKeyset.Keys) if err != nil { return "", fmt.Errorf("failed to parse keys for %s: %w", chosen.mint, err) } diff --git a/nip60/swap.go b/nip60/swap.go index f8fdcce..8c21cee 100644 --- a/nip60/swap.go +++ b/nip60/swap.go @@ -33,7 +33,7 @@ func (w *Wallet) swapProofs( if err != nil { return nil, nil, fmt.Errorf("failed to get active keyset for %s: %w", mint, err) } - ksKeys, err := parseKeysetKeys(activeKeyset.Keys) + ksKeys, err := ParseKeysetKeys(activeKeyset.Keys) if err != nil { return nil, nil, fmt.Errorf("failed to parse keys for %s: %w", mint, err) }