mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
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.
20 lines
436 B
Go
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)
|
|
}
|