channeldb: inject clock into database
Use our standard clock mock for database time queries.
This commit is contained in:
7 files changed
+29
-15
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user