mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 23:21:12 +02:00
contractcourt: add Launch
method to outgoing contest resolver
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -159,6 +160,7 @@ func newOutgoingResolverTestContext(t *testing.T) *outgoingResolverTestContext {
|
||||
|
||||
return nil
|
||||
},
|
||||
ChainIO: &mock.ChainIO{},
|
||||
},
|
||||
PutResolverReport: func(_ kvdb.RwTx,
|
||||
_ *channeldb.ResolverReport) error {
|
||||
@@ -195,6 +197,7 @@ func newOutgoingResolverTestContext(t *testing.T) *outgoingResolverTestContext {
|
||||
},
|
||||
},
|
||||
}
|
||||
resolver.initLogger("htlcOutgoingContestResolver")
|
||||
|
||||
return &outgoingResolverTestContext{
|
||||
resolver: resolver,
|
||||
@@ -209,6 +212,9 @@ func (i *outgoingResolverTestContext) resolve() {
|
||||
// Start resolver.
|
||||
i.resolverResultChan = make(chan resolveResult, 1)
|
||||
go func() {
|
||||
err := i.resolver.Launch()
|
||||
require.NoError(i.t, err)
|
||||
|
||||
nextResolver, err := i.resolver.Resolve()
|
||||
i.resolverResultChan <- resolveResult{
|
||||
nextResolver: nextResolver,
|
||||
|
Reference in New Issue
Block a user