multi: wrap all errors

This commit is contained in:
Oliver Gugger authored and Andras Banki-Horvath committed 2024-04-11 15:04:03 +02:00
1 parent 9a28a4c105
commit 648fb22f63
60 files changed
+138 -133

No files matched your search

+3 -3
View File
@@ -450,7 +450,7 @@ func signSegWitV0(in *psbt.PInput, tx *wire.MsgTx,
in.SighashType, privKey,
)
if err != nil {
return fmt.Errorf("error signing input %d: %v", idx, err)
return fmt.Errorf("error signing input %d: %w", idx, err)
}
in.PartialSigs = append(in.PartialSigs, &psbt.PartialSig{
PubKey: pubKeyBytes,
@@ -472,7 +472,7 @@ func signSegWitV1KeySpend(in *psbt.PInput, tx *wire.MsgTx,
privKey,
)
if err != nil {
return fmt.Errorf("error signing taproot input %d: %v", idx,
return fmt.Errorf("error signing taproot input %d: %w", idx,
err)
}
@@ -492,7 +492,7 @@ func signSegWitV1ScriptSpend(in *psbt.PInput, tx *wire.MsgTx,
in.WitnessUtxo.PkScript, leaf, in.SighashType, privKey,
)
if err != nil {
return fmt.Errorf("error signing taproot script input %d: %v",
return fmt.Errorf("error signing taproot script input %d: %w",
idx, err)
}
+2 -2
View File
@@ -192,7 +192,7 @@ func (i *PsbtIntent) FundingParams() (btcutil.Address, int64, *psbt.Packet,
// Encode the address in the human-readable bech32 format.
addr, err := script.Address(i.netParams)
if err != nil {
return nil, 0, nil, fmt.Errorf("unable to encode address: %v",
return nil, 0, nil, fmt.Errorf("unable to encode address: %w",
err)
}
@@ -204,7 +204,7 @@ func (i *PsbtIntent) FundingParams() (btcutil.Address, int64, *psbt.Packet,
packet, err = psbt.New(nil, nil, 2, 0, nil)
if err != nil {
return nil, 0, nil, fmt.Errorf("unable to create "+
"PSBT: %v", err)
"PSBT: %w", err)
}
}
packet.UnsignedTx.TxOut = append(packet.UnsignedTx.TxOut, out)
+7 -7
View File
@@ -533,12 +533,12 @@ func (r *RPCKeyRing) SignMessageSchnorr(keyLoc keychain.KeyLocator,
if err != nil {
considerShutdown(err)
return nil, fmt.Errorf("error signing message in remote "+
"signer instance: %v", err)
"signer instance: %w", err)
}
sigParsed, err := schnorr.ParseSignature(resp.Signature)
if err != nil {
return nil, fmt.Errorf("can't parse schnorr signature: %v",
return nil, fmt.Errorf("can't parse schnorr signature: %w",
err)
}
return sigParsed, nil
@@ -634,7 +634,7 @@ func (r *RPCKeyRing) ComputeInputScript(tx *wire.MsgTx,
// input.
sig, err := r.remoteSign(tx, signDesc, witnessProgram)
if err != nil {
return nil, fmt.Errorf("error signing with remote instance: %v",
return nil, fmt.Errorf("error signing with remote instance: %w",
err)
}
@@ -740,7 +740,7 @@ func (r *RPCKeyRing) MuSig2CreateSession(bipVersion input.MuSig2Version,
resp.TaprootInternalKey,
)
if err != nil {
return nil, fmt.Errorf("error parsing internal key: %v",
return nil, fmt.Errorf("error parsing internal key: %w",
err)
}
}
@@ -1261,7 +1261,7 @@ func connectRPC(hostPort, tlsCertPath, macaroonPath string,
certBytes, err := ioutil.ReadFile(tlsCertPath)
if err != nil {
return nil, fmt.Errorf("error reading TLS cert file %v: %v",
return nil, fmt.Errorf("error reading TLS cert file %v: %w",
tlsCertPath, err)
}
@@ -1273,7 +1273,7 @@ func connectRPC(hostPort, tlsCertPath, macaroonPath string,
macBytes, err := ioutil.ReadFile(macaroonPath)
if err != nil {
return nil, fmt.Errorf("error reading macaroon file %v: %v",
return nil, fmt.Errorf("error reading macaroon file %v: %w",
macaroonPath, err)
}
mac := &macaroon.Macaroon{}
@@ -1297,7 +1297,7 @@ func connectRPC(hostPort, tlsCertPath, macaroonPath string,
defer cancel()
conn, err := grpc.DialContext(ctxt, hostPort, opts...)
if err != nil {
return nil, fmt.Errorf("unable to connect to RPC server: %v",
return nil, fmt.Errorf("unable to connect to RPC server: %w",
err)
}