mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
As the legacy `NewTestPostgresDB` function is no longer used and has been removed, it no longer makes sense to have a `V2` suffix on the `NewTestPostgresV2DB` function. This commit renames it to `NewTestPostgresDB`, to indicate that this function now replaces the legacy function.
24 lines
750 B
Go
24 lines
750 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"
|
|
)
|
|
|
|
// isSqlite is true if the test_db_sqlite build flag is set.
|
|
var isSqlite = false
|
|
|
|
// NewTestDB is a helper function that creates an BBolt database for testing.
|
|
func NewTestDB(t *testing.T, clock clock.Clock) FirewallDBs {
|
|
return createStore(t, 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) FirewallDBs {
|
|
return createStore(t, db.NewTestPostgresDB(t).BaseDB, clock)
|
|
}
|