lnwallet: fix linter issues in signer

This commit is contained in:
Oliver Gugger committed 2023-02-06 10:50:30 +01:00
1 parent 13252aec1d
commit dcf21e506a
1 file changed
+11 -9
+11 -9
View File
@@ -26,7 +26,9 @@ import (
// of ErrNotMine should be returned instead. // of ErrNotMine should be returned instead.
// //
// This is a part of the WalletController interface. // This is a part of the WalletController interface.
func (b *BtcWallet) FetchInputInfo(prevOut *wire.OutPoint) (*lnwallet.Utxo, error) { func (b *BtcWallet) FetchInputInfo(prevOut *wire.OutPoint) (*lnwallet.Utxo,
error) {
prevTx, txOut, bip32, confirmations, err := b.wallet.FetchInputInfo( prevTx, txOut, bip32, confirmations, err := b.wallet.FetchInputInfo(
prevOut, prevOut,
) )
@@ -501,7 +503,7 @@ func (b *BtcWallet) MuSig2CreateSession(bipVersion input.MuSig2Version,
KeyLocator: keyLoc, KeyLocator: keyLoc,
}) })
if err != nil { if err != nil {
return nil, fmt.Errorf("error deriving private key: %v", err) return nil, fmt.Errorf("error deriving private key: %w", err)
} }
// Create a signing context and session with the given private key and // Create a signing context and session with the given private key and
@@ -510,7 +512,7 @@ func (b *BtcWallet) MuSig2CreateSession(bipVersion input.MuSig2Version,
bipVersion, privKey, allSignerPubKeys, tweaks, bipVersion, privKey, allSignerPubKeys, tweaks,
) )
if err != nil { if err != nil {
return nil, fmt.Errorf("error creating signing context: %v", return nil, fmt.Errorf("error creating signing context: %w",
err) err)
} }
@@ -522,14 +524,14 @@ func (b *BtcWallet) MuSig2CreateSession(bipVersion input.MuSig2Version,
) )
if err != nil { if err != nil {
return nil, fmt.Errorf("error registering other "+ return nil, fmt.Errorf("error registering other "+
"signer public nonce: %v", err) "signer public nonce: %w", err)
} }
} }
// Register the new session. // Register the new session.
combinedKey, err := muSigContext.CombinedKey() combinedKey, err := muSigContext.CombinedKey()
if err != nil { if err != nil {
return nil, fmt.Errorf("error getting combined key: %v", err) return nil, fmt.Errorf("error getting combined key: %w", err)
} }
session := &muSig2State{ session := &muSig2State{
MuSig2SessionInfo: input.MuSig2SessionInfo{ MuSig2SessionInfo: input.MuSig2SessionInfo{
@@ -551,7 +553,7 @@ func (b *BtcWallet) MuSig2CreateSession(bipVersion input.MuSig2Version,
if tweaks.HasTaprootTweak() { if tweaks.HasTaprootTweak() {
internalKey, err := muSigContext.TaprootInternalKey() internalKey, err := muSigContext.TaprootInternalKey()
if err != nil { if err != nil {
return nil, fmt.Errorf("error getting internal key: %v", return nil, fmt.Errorf("error getting internal key: %w",
err) err)
} }
session.TaprootInternalKey = internalKey session.TaprootInternalKey = internalKey
@@ -607,7 +609,7 @@ func (b *BtcWallet) MuSig2RegisterNonces(sessionID input.MuSig2SessionID,
) )
if err != nil { if err != nil {
return false, fmt.Errorf("error registering other "+ return false, fmt.Errorf("error registering other "+
"signer public nonce: %v", err) "signer public nonce: %w", err)
} }
} }
@@ -646,7 +648,7 @@ func (b *BtcWallet) MuSig2Sign(sessionID input.MuSig2SessionID,
// Create our own partial signature with the local signing key. // Create our own partial signature with the local signing key.
partialSig, err := input.MuSig2Sign(session.session, msg, true) partialSig, err := input.MuSig2Sign(session.session, msg, true)
if err != nil { if err != nil {
return nil, fmt.Errorf("error signing with local key: %v", err) return nil, fmt.Errorf("error signing with local key: %w", err)
} }
// Clean up our local state if requested. // Clean up our local state if requested.
@@ -695,7 +697,7 @@ func (b *BtcWallet) MuSig2CombineSig(sessionID input.MuSig2SessionID,
) )
if err != nil { if err != nil {
return nil, false, fmt.Errorf("error combining "+ return nil, false, fmt.Errorf("error combining "+
"partial signature: %v", err) "partial signature: %w", err)
} }
} }