htlcswitch/mock: remove mockTicker, use ticker.MockNew

This commit is contained in:
Conner Fromknecht 2018-08-02 02:14:55 -07:00
parent 2651136806
commit 6a709526d8
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

@ -26,6 +26,7 @@ import (
"github.com/lightningnetwork/lnd/lnpeer"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/ticker"
)
type mockPreimageCache struct {
@ -144,6 +145,8 @@ func initSwitchWithDB(startingHeight uint32, db *channeldb.DB) (*Switch, error)
return nil, nil
},
Notifier: &mockNotifier{},
FwdEventTicker: ticker.MockNew(DefaultFwdEventInterval),
LogEventTicker: ticker.MockNew(DefaultLogInterval),
}
return New(cfg, startingHeight)
@ -807,14 +810,3 @@ func (m *mockNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint, _ []byte,
Spend: make(chan *chainntnfs.SpendDetail),
}, nil
}
type mockTicker struct {
ticker <-chan time.Time
}
func (m *mockTicker) Start() <-chan time.Time {
return m.ticker
}
func (m *mockTicker) Stop() {
}