From c90ec1959541128d21ca2f223128903477870a7e Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Wed, 1 Aug 2018 14:19:29 -0700 Subject: [PATCH] htlcswitch/test_utils: repalce mockTicker with new MockTicker --- htlcswitch/test_utils.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htlcswitch/test_utils.go b/htlcswitch/test_utils.go index 46bf718f..7500be1a 100644 --- a/htlcswitch/test_utils.go +++ b/htlcswitch/test_utils.go @@ -28,6 +28,7 @@ import ( "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/shachain" + "github.com/lightningnetwork/lnd/ticker" ) var ( @@ -918,8 +919,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel, ChainEvents: &contractcourt.ChainEventSubscription{}, SyncStates: true, BatchSize: 10, - BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, - FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, + BatchTicker: ticker.MockNew(batchTimeout), + FwdPkgGCTicker: ticker.MockNew(fwdPkgTimeout), MinFeeUpdateTimeout: minFeeUpdateTimeout, MaxFeeUpdateTimeout: maxFeeUpdateTimeout, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, @@ -961,8 +962,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel, ChainEvents: &contractcourt.ChainEventSubscription{}, SyncStates: true, BatchSize: 10, - BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, - FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, + BatchTicker: ticker.MockNew(batchTimeout), + FwdPkgGCTicker: ticker.MockNew(fwdPkgTimeout), MinFeeUpdateTimeout: minFeeUpdateTimeout, MaxFeeUpdateTimeout: maxFeeUpdateTimeout, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, @@ -1004,8 +1005,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel, ChainEvents: &contractcourt.ChainEventSubscription{}, SyncStates: true, BatchSize: 10, - BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, - FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, + BatchTicker: ticker.MockNew(batchTimeout), + FwdPkgGCTicker: ticker.MockNew(fwdPkgTimeout), MinFeeUpdateTimeout: minFeeUpdateTimeout, MaxFeeUpdateTimeout: maxFeeUpdateTimeout, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {}, @@ -1047,8 +1048,8 @@ func newThreeHopNetwork(t testing.TB, aliceChannel, firstBobChannel, ChainEvents: &contractcourt.ChainEventSubscription{}, SyncStates: true, BatchSize: 10, - BatchTicker: &mockTicker{time.NewTicker(batchTimeout).C}, - FwdPkgGCTicker: &mockTicker{time.NewTicker(fwdPkgTimeout).C}, + BatchTicker: ticker.MockNew(batchTimeout), + FwdPkgGCTicker: ticker.MockNew(fwdPkgTimeout), MinFeeUpdateTimeout: minFeeUpdateTimeout, MaxFeeUpdateTimeout: maxFeeUpdateTimeout, OnChannelFailure: func(lnwire.ChannelID, lnwire.ShortChannelID, LinkFailureError) {},