htlcswitch: add set of tests for the forwarding log

This commit is contained in:
Olaoluwa Osuntokun committed 2018-03-06 13:56:11 -05:00
1 parent ad522a72c1
commit 473dfd115b
4 files changed
+210 -14

No files matched your search

+12 -7
View File
@@ -82,6 +82,7 @@ var _ lnwallet.FeeEstimator = (*mockFeeEstimator)(nil)
type mockForwardingLog struct {
sync.Mutex
events map[time.Time]channeldb.ForwardingEvent
}
@@ -124,13 +125,17 @@ func newMockServer(t testing.TB, name string) *mockServer {
copy(id[:], h[:])
return &mockServer{
t: t,
id: id,
name: name,
messages: make(chan lnwire.Message, 3000),
quit: make(chan struct{}),
registry: newMockRegistry(),
htlcSwitch: New(Config{}),
t: t,
id: id,
name: name,
messages: make(chan lnwire.Message, 3000),
quit: make(chan struct{}),
registry: newMockRegistry(),
htlcSwitch: New(Config{
FwdingLog: &mockForwardingLog{
events: make(map[time.Time]channeldb.ForwardingEvent),
},
}),
interceptorFuncs: make([]messageInterceptor, 0),
}
}