@@ -2,17 +2,16 @@ package session
2
2
3
3
import (
4
4
"context"
5
- "database/sql"
6
5
"fmt"
7
6
"testing"
8
7
"time"
9
8
10
9
"github.com/lightninglabs/lightning-terminal/accounts"
11
- "github.com/lightninglabs/lightning-terminal/db"
10
+ "github.com/lightninglabs/lightning-terminal/db/sqlc "
12
11
"github.com/lightningnetwork/lnd/clock"
13
12
"github.com/lightningnetwork/lnd/lnwire"
14
13
"github.com/lightningnetwork/lnd/macaroons"
15
- "github.com/lightningnetwork/lnd/sqldb"
14
+ "github.com/lightningnetwork/lnd/sqldb/v2 "
16
15
"github.com/stretchr/testify/require"
17
16
"go.etcd.io/bbolt"
18
17
"golang.org/x/exp/rand"
@@ -38,7 +37,7 @@ func TestSessionsStoreMigration(t *testing.T) {
38
37
}
39
38
40
39
makeSQLDB := func (t * testing.T , acctStore accounts.Store ) (* SQLStore ,
41
- * db. TransactionExecutor [SQLQueries ]) {
40
+ * SQLQueriesExecutor [SQLQueries ]) {
42
41
43
42
// Create a sql store with a linked account store.
44
43
testDBStore := NewTestDBWithAccounts (t , clock , acctStore )
@@ -48,13 +47,9 @@ func TestSessionsStoreMigration(t *testing.T) {
48
47
49
48
baseDB := store .BaseDB
50
49
51
- genericExecutor := db .NewTransactionExecutor (
52
- baseDB , func (tx * sql.Tx ) SQLQueries {
53
- return baseDB .WithTx (tx )
54
- },
55
- )
50
+ queries := sqlc .NewForType (baseDB , baseDB .BackendType )
56
51
57
- return store , genericExecutor
52
+ return store , NewSQLQueriesExecutor ( baseDB , queries )
58
53
}
59
54
60
55
// assertMigrationResults asserts that the sql store contains the
@@ -375,7 +370,7 @@ func TestSessionsStoreMigration(t *testing.T) {
375
370
return MigrateSessionStoreToSQL (
376
371
ctx , kvStore .DB , tx ,
377
372
)
378
- },
373
+ }, sqldb . NoOpReset ,
379
374
)
380
375
require .NoError (t , err )
381
376
0 commit comments