channeldb: inject clock into database

Use our standard clock mock for database time queries.
This commit is contained in:
Joost Jager
2020-01-20 10:57:34 +01:00
parent ad0a89b844
commit b600ecda86
7 changed files with 29 additions and 15 deletions

View File

@@ -304,7 +304,6 @@ func TestInvoiceAddTimeSeries(t *testing.T) {
if err != nil {
t.Fatalf("unable to make test db: %v", err)
}
db.Now = func() time.Time { return testNow }
// We'll start off by creating 20 random invoices, and inserting them
// into the database.
@@ -556,7 +555,6 @@ func TestDuplicateSettleInvoice(t *testing.T) {
if err != nil {
t.Fatalf("unable to make test db: %v", err)
}
db.Now = func() time.Time { return testNow }
// We'll start out by creating an invoice and writing it to the DB.
amt := lnwire.NewMSatFromSatoshis(1000)
@@ -631,7 +629,6 @@ func TestQueryInvoices(t *testing.T) {
if err != nil {
t.Fatalf("unable to make test db: %v", err)
}
db.Now = func() time.Time { return testNow }
// To begin the test, we'll add 50 invoices to the database. We'll
// assume that the index of the invoice within the database is the same