lightning-terminal/session/test_sql.go
Elle Mouton 60da67d50a
session: add SQL CRUD
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`.
2025-03-25 16:58:01 +02:00

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