lnwallet: add new aux resolver interface

This will be used by external callers to modify the way we resolve
contracts on chain. For a given contract, we'll store an extra "blob",
that will later be presented during the sweeping phase.
This commit is contained in:
Olaoluwa Osuntokun
2024-06-03 22:58:57 -07:00
committed by Oliver Gugger
parent 900a0a114a
commit f4710ca639
8 changed files with 303 additions and 23 deletions

View File

@@ -1592,6 +1592,9 @@ func testBreachSpends(t *testing.T, test breachTest) {
retribution, err := lnwallet.NewBreachRetribution(
alice.State(), height, 1, forceCloseTx,
fn.Some[lnwallet.AuxLeafStore](&lnwallet.MockAuxLeafStore{}),
fn.Some[lnwallet.AuxContractResolver](
&lnwallet.MockAuxContractResolver{},
),
)
require.NoError(t, err, "unable to create breach retribution")
@@ -1802,6 +1805,9 @@ func TestBreachDelayedJusticeConfirmation(t *testing.T) {
retribution, err := lnwallet.NewBreachRetribution(
alice.State(), height, uint32(blockHeight), forceCloseTx,
fn.Some[lnwallet.AuxLeafStore](&lnwallet.MockAuxLeafStore{}),
fn.Some[lnwallet.AuxContractResolver](
&lnwallet.MockAuxContractResolver{},
),
)
require.NoError(t, err, "unable to create breach retribution")