Skip to content

Commit

Permalink
fixup! fixup! lnwallet+channeldb: add new AuxLeafStore for dynamic au…
Browse files Browse the repository at this point in the history
…x leaves
  • Loading branch information
guggero committed Apr 16, 2024
1 parent 48a1317 commit f7f875b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions contractcourt/breach_arbitrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/go-errors/errors"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lntest/channels"
Expand Down Expand Up @@ -1585,6 +1586,7 @@ func testBreachSpends(t *testing.T, test breachTest) {
// Notify the breach arbiter about the breach.
retribution, err := lnwallet.NewBreachRetribution(

Check failure on line 1587 in contractcourt/breach_arbitrator_test.go

View workflow job for this annotation

GitHub Actions / check commits

not enough arguments in call to lnwallet.NewBreachRetribution
alice.State(), height, 1, forceCloseTx,
fn.None[lnwallet.AuxLeafStore](),
)
require.NoError(t, err, "unable to create breach retribution")

Expand Down Expand Up @@ -1794,6 +1796,7 @@ func TestBreachDelayedJusticeConfirmation(t *testing.T) {
// Notify the breach arbiter about the breach.

Check failure on line 1796 in contractcourt/breach_arbitrator_test.go

View workflow job for this annotation

GitHub Actions / check commits

not enough arguments in call to lnwallet.NewBreachRetribution
retribution, err := lnwallet.NewBreachRetribution(
alice.State(), height, uint32(blockHeight), forceCloseTx,
fn.None[lnwallet.AuxLeafStore](),
)
require.NoError(t, err, "unable to create breach retribution")

Expand Down
3 changes: 2 additions & 1 deletion input/size_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,7 @@ func genTimeoutTx(t *testing.T,
timeoutTx, err := lnwallet.CreateHtlcTimeoutTx(
chanType, false, testOutPoint, testAmt, testCLTVExpiry,
testCSVDelay, 0, testPubkey, testPubkey,

Check failure on line 1390 in input/size_test.go

View workflow job for this annotation

GitHub Actions / check commits

not enough arguments in call to lnwallet.CreateHtlcTimeoutTx
fn.None[txscript.TapLeaf](),
)
require.NoError(t, err)

Expand Down Expand Up @@ -1456,7 +1457,7 @@ func genSuccessTx(t *testing.T, chanType channeldb.ChannelType) *wire.MsgTx {
// Create the unsigned success tx.
successTx, err := lnwallet.CreateHtlcSuccessTx(
chanType, false, testOutPoint, testAmt, testCSVDelay, 0,

Check failure on line 1459 in input/size_test.go

View workflow job for this annotation

GitHub Actions / check commits

not enough arguments in call to lnwallet.CreateHtlcSuccessTx
testPubkey, testPubkey,
testPubkey, testPubkey, fn.None[txscript.TapLeaf](),
)
require.NoError(t, err)

Expand Down
1 change: 1 addition & 0 deletions lnwallet/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/tlv"
"github.com/stretchr/testify/require"
)

Expand Down
5 changes: 3 additions & 2 deletions watchtower/lookout/justice_descriptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion watchtower/wtclient/backup_task_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnwallet"
Expand Down Expand Up @@ -136,6 +137,7 @@ func genTaskTest(
if chanType.IsTaproot() {
scriptTree, _ := input.NewLocalCommitScriptTree(
csvDelay, toLocalPK, revPK,
fn.None[txscript.TapLeaf](),
)

pkScript, _ := input.PayToTaprootScript(
Expand Down Expand Up @@ -189,7 +191,7 @@ func genTaskTest(

if chanType.IsTaproot() {
scriptTree, _ := input.NewRemoteCommitScriptTree(
toRemotePK,
toRemotePK, fn.None[txscript.TapLeaf](),
)

pkScript, _ := input.PayToTaprootScript(
Expand Down
7 changes: 5 additions & 2 deletions watchtower/wtclient/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/channelnotifier"
"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/kvdb"
Expand Down Expand Up @@ -230,12 +231,14 @@ func (c *mockChannel) createRemoteCommitTx(t *testing.T) {

// Construct the to-local witness script.
toLocalScriptTree, err := input.NewLocalCommitScriptTree(
c.csvDelay, c.toLocalPK, c.revPK,
c.csvDelay, c.toLocalPK, c.revPK, fn.None[txscript.TapLeaf](),
)
require.NoError(t, err, "unable to create to-local script")

// Construct the to-remote witness script.
toRemoteScriptTree, err := input.NewRemoteCommitScriptTree(c.toRemotePK)
toRemoteScriptTree, err := input.NewRemoteCommitScriptTree(
c.toRemotePK, fn.None[txscript.TapLeaf](),
)
require.NoError(t, err, "unable to create to-remote script")

// Compute the to-local witness script hash.
Expand Down

0 comments on commit f7f875b

Please sign in to comment.