invoices/test: add height expiry watcher tests with registry

This commit is contained in:
carla
2021-05-11 08:45:33 +02:00
parent 8066ff7047
commit 74373f26b9
2 changed files with 222 additions and 1 deletions

View File

@@ -181,6 +181,7 @@ func newTestChannelDB(clock clock.Clock) (*channeldb.DB, func(), error) {
type testContext struct {
cdb *channeldb.DB
registry *InvoiceRegistry
notifier *mockChainNotifier
clock *clock.TestClock
cleanup func()
@@ -195,8 +196,10 @@ func newTestContext(t *testing.T) *testContext {
t.Fatal(err)
}
notifier := newMockNotifier()
expiryWatcher := NewInvoiceExpiryWatcher(
clock, 0, uint32(testCurrentHeight), nil, newMockNotifier(),
clock, 0, uint32(testCurrentHeight), nil, notifier,
)
// Instantiate and start the invoice ctx.registry.
@@ -216,6 +219,7 @@ func newTestContext(t *testing.T) *testContext {
ctx := testContext{
cdb: cdb,
registry: registry,
notifier: notifier,
clock: clock,
t: t,
cleanup: func() {