lnwire: update Sig to support both ECDSA and schnorr sigs
In this commit, we update the Sig type to support ECDSA and schnorr signatures. We need to do this as the HTLC signatures will become schnorr sigs for taproot channels. The current spec draft opts to overload this field since both the sigs are actually 64 bytes in length. The only consideration with this move is that callers need to "coerce" a sig to the proper type if they need schnorr signatures.
This commit is contained in:
29 files changed
+296
-128
No files matched your search
@@ -5331,7 +5331,11 @@ func TestInvalidCommitSigError(t *testing.T) {
|
||||
|
||||
// Before the signature gets to Bob, we'll mutate it, such that the
|
||||
// signature is now actually invalid.
|
||||
aliceSig[0] ^= 88
|
||||
aliceSigCopy := aliceSig.Copy()
|
||||
aliceSigCopyBytes := aliceSigCopy.RawBytes()
|
||||
aliceSigCopyBytes[0] ^= 88
|
||||
aliceSig, err = lnwire.NewSigFromWireECDSA(aliceSigCopyBytes)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Bob should reject this new state, and return the proper error.
|
||||
err = bobChannel.ReceiveNewCommitment(aliceSig, aliceHtlcSigs)
|
||||
|
||||
Reference in new issue
Block a user