multi: move mockChainIO, mockNotifier to lntest/mock

This commit is contained in:
eugene
2020-08-27 15:34:55 -04:00
parent 3fa5d042c9
commit c7cbacc35b
18 changed files with 241 additions and 308 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/channeldb/kvdb"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/lntest/mock"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
@@ -80,7 +81,7 @@ func TestHtlcOutgoingResolverRemoteClaim(t *testing.T) {
spendHash := spendTx.TxHash()
ctx.notifier.spendChan <- &chainntnfs.SpendDetail{
ctx.notifier.SpendChan <- &chainntnfs.SpendDetail{
SpendingTx: spendTx,
SpenderTxHash: &spendHash,
}
@@ -114,7 +115,7 @@ type resolveResult struct {
type outgoingResolverTestContext struct {
resolver *htlcOutgoingContestResolver
notifier *mockNotifier
notifier *mock.ChainNotifier
preimageDB *mockWitnessBeacon
resolverResultChan chan resolveResult
resolutionChan chan ResolutionMsg
@@ -122,10 +123,10 @@ type outgoingResolverTestContext struct {
}
func newOutgoingResolverTestContext(t *testing.T) *outgoingResolverTestContext {
notifier := &mockNotifier{
epochChan: make(chan *chainntnfs.BlockEpoch),
spendChan: make(chan *chainntnfs.SpendDetail),
confChan: make(chan *chainntnfs.TxConfirmation),
notifier := &mock.ChainNotifier{
EpochChan: make(chan *chainntnfs.BlockEpoch),
SpendChan: make(chan *chainntnfs.SpendDetail),
ConfChan: make(chan *chainntnfs.TxConfirmation),
}
checkPointChan := make(chan struct{}, 1)
@@ -212,7 +213,7 @@ func (i *outgoingResolverTestContext) resolve() {
}
func (i *outgoingResolverTestContext) notifyEpoch(height int32) {
i.notifier.epochChan <- &chainntnfs.BlockEpoch{
i.notifier.EpochChan <- &chainntnfs.BlockEpoch{
Height: height,
}
}