lightning-terminal/session/test_sql.go
Viktor Tigerström b48e40f000
session: update NewTestDB funcs to return Store
In preparation for upcoming migration tests from a kvdb to an SQL store,
this commit updates the NewTestDB function to return the Store interface
rather than a concrete store implementation.

This change ensures that migration tests can call NewTestDB under any
build tag while receiving a consistent return type.
2025-06-12 11:52:38 +02:00

20 lines
436 B
Go

//go:build test_db_postgres || test_db_sqlite
package session
import (
"testing"
"github.com/lightninglabs/lightning-terminal/accounts"
"github.com/lightningnetwork/lnd/clock"
"github.com/stretchr/testify/require"
)
func NewTestDBWithAccounts(t *testing.T, clock clock.Clock,
acctStore accounts.Store) Store {
accounts, ok := acctStore.(*accounts.SQLStore)
require.True(t, ok)
return NewSQLStore(accounts.BaseDB, clock)
}