input+lnwallet: update taproot scripts to accept optional aux leaf

In this commit, we update all the taproot scripts to also accept an
optional aux leaf. This aux leaf can be used to add more redemption
paths for advanced channels, or just as an extra commitment space.
This commit is contained in:
Olaoluwa Osuntokun
2024-03-15 11:43:21 -04:00
committed by Oliver Gugger
parent 8588c9bfd7
commit 1aae47fd71
11 changed files with 273 additions and 108 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
secp "github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnwallet"
@@ -123,7 +124,7 @@ func testJusticeDescriptor(t *testing.T, blobType blob.Type) {
if isTaprootChannel {
toLocalCommitTree, err = input.NewLocalCommitScriptTree(
csvDelay, toLocalPK, revPK,
csvDelay, toLocalPK, revPK, fn.None[txscript.TapLeaf](),
)
require.NoError(t, err)
@@ -174,7 +175,7 @@ func testJusticeDescriptor(t *testing.T, blobType blob.Type) {
toRemoteSequence = 1
commitScriptTree, err := input.NewRemoteCommitScriptTree(
toRemotePK,
toRemotePK, fn.None[txscript.TapLeaf](),
)
require.NoError(t, err)