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

+6 -6
View File
@@ -710,14 +710,14 @@ func (s *Server) VerifyMessage(_ context.Context,
// for Schnorr signatures.
pubkey, err := schnorr.ParsePubKey(in.Pubkey)
if err != nil {
return nil, fmt.Errorf("unable to parse pubkey: %v",
return nil, fmt.Errorf("unable to parse pubkey: %w",
err)
}
sigParsed, err := schnorr.ParseSignature(in.Signature)
if err != nil {
return nil, fmt.Errorf("can't parse Schnorr "+
"signature: %v", err)
"signature: %w", err)
}
var digest []byte
@@ -746,7 +746,7 @@ func (s *Server) VerifyMessage(_ context.Context,
}
sig, err := wireSig.ToSignature()
if err != nil {
return nil, fmt.Errorf("failed to convert from wire format: %v",
return nil, fmt.Errorf("failed to convert from wire format: %w",
err)
}
@@ -874,7 +874,7 @@ func (s *Server) MuSig2CombineKeys(_ context.Context,
// Are there any tweaks to apply to the combined public key?
tweaks, err := UnmarshalTweaks(in.Tweaks, in.TaprootTweak)
if err != nil {
return nil, fmt.Errorf("error unmarshaling tweak options: %v",
return nil, fmt.Errorf("error unmarshaling tweak options: %w",
err)
}
@@ -1014,7 +1014,7 @@ func (s *Server) MuSig2CreateSession(_ context.Context,
// Are there any tweaks to apply to the combined public key?
tweaks, err := UnmarshalTweaks(in.Tweaks, in.TaprootTweak)
if err != nil {
return nil, fmt.Errorf("error unmarshaling tweak options: %v",
return nil, fmt.Errorf("error unmarshaling tweak options: %w",
err)
}
@@ -1139,7 +1139,7 @@ func (s *Server) MuSig2CombineSig(_ context.Context,
in.OtherPartialSignatures,
)
if err != nil {
return nil, fmt.Errorf("error parsing partial signatures: %v",
return nil, fmt.Errorf("error parsing partial signatures: %w",
err)
}