mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-16 13:01:14 +02:00
This commit adds the SQL implementation of the session.Store interface. This can be run against all session unit tests via `make unit pkg=session tags=test_db_sqlite` and `make unit pkg=session tags=test_db_postgres`.
20 lines
440 B
Go
20 lines
440 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) *SQLStore {
|
|
|
|
accounts, ok := acctStore.(*accounts.SQLStore)
|
|
require.True(t, ok)
|
|
|
|
return NewSQLStore(accounts.BaseDB, clock)
|
|
}
|