mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
In preparation for using the clock to get an Action's AttemptedAt time in an upcoming commit, we let both the bbolt and SQL impls of the firewalldb take a clock.
21 lines
645 B
Go
21 lines
645 B
Go
//go:build test_db_postgres && !test_db_sqlite
|
|
|
|
package firewalldb
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/lightninglabs/lightning-terminal/db"
|
|
"github.com/lightningnetwork/lnd/clock"
|
|
)
|
|
|
|
// NewTestDB is a helper function that creates an BBolt database for testing.
|
|
func NewTestDB(t *testing.T, clock clock.Clock) *SQLDB {
|
|
return NewSQLDB(db.NewTestPostgresDB(t).BaseDB, clock)
|
|
}
|
|
|
|
// NewTestDBFromPath is a helper function that creates a new BoltStore with a
|
|
// connection to an existing BBolt database for testing.
|
|
func NewTestDBFromPath(t *testing.T, _ string, clock clock.Clock) *SQLDB {
|
|
return NewSQLDB(db.NewTestPostgresDB(t).BaseDB, clock)
|
|
}
|