input+lnwallet: put MuSig2 types behind interface

We put the calls that don't use musig2 package specific types as
parameters or return values behind an interface so we can easily call
those directly in the RPC without needing to know the underlying
implementation version. Some calls can't be used in the interface
because they use the specific package version's types. These calls are
implemented in helper functions in the input package instead that do the
necessary type switches.
This commit is contained in:
Oliver Gugger
2023-01-27 16:13:16 +01:00
parent cb9f2d0398
commit 0e5ce71b33
2 changed files with 79 additions and 19 deletions

View File

@@ -476,11 +476,11 @@ type muSig2State struct {
// context is the signing context responsible for keeping track of the
// public keys involved in the signing process.
context *musig2.Context
context input.MuSig2Context
// session is the signing session responsible for keeping track of the
// nonces and partial signatures involved in the signing process.
session *musig2.Session
session input.MuSig2Session
}
// MuSig2CreateSession creates a new MuSig2 signing session using the local