mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-11-20 02:57:42 +01:00
nip60: expose ParseKeysetKeys()
This commit is contained in:
@@ -184,7 +184,7 @@ func unblindSignature(C_str string, r *secp256k1.PrivateKey, key *secp256k1.Publ
|
|||||||
return Cstr, nil
|
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)
|
parsedKeys := make(map[uint64]*btcec.PublicKey)
|
||||||
for amount, pkh := range keys {
|
for amount, pkh := range keys {
|
||||||
pkb, err := hex.DecodeString(pkh)
|
pkb, err := hex.DecodeString(pkh)
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ func redeemMinted(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// unblind the signatures from the promises and build the blinded messages
|
// unblind the signatures from the promises and build the blinded messages
|
||||||
keysetKeys, err := parseKeysetKeys(keyset.Keys)
|
keysetKeys, err := ParseKeysetKeys(keyset.Keys)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("target mint %s sent us an invalid keyset: %w", mint, err)
|
return nil, fmt.Errorf("target mint %s sent us an invalid keyset: %w", mint, err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ meltworked:
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to get active keyset for %s: %w", chosen.mint, err)
|
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 {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to parse keys for %s: %w", chosen.mint, err)
|
return "", fmt.Errorf("failed to parse keys for %s: %w", chosen.mint, err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func (w *Wallet) swapProofs(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("failed to get active keyset for %s: %w", mint, err)
|
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 {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("failed to parse keys for %s: %w", mint, err)
|
return nil, nil, fmt.Errorf("failed to parse keys for %s: %w", mint, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user