lightning-terminal/firewalldb/test_postgres.go
Viktor Torstensson eb26c2b1c5
mutli: rename db.NewTestPostgresV2DB function
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.
2026-05-14 11:37:54 +02:00

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)
}