@@ -6,42 +6,46 @@ import (
6
6
"testing"
7
7
8
8
"github.com/lightninglabs/lightning-terminal/accounts"
9
+ "github.com/lightninglabs/lightning-terminal/session"
9
10
"github.com/lightningnetwork/lnd/clock"
10
11
"github.com/lightningnetwork/lnd/fn"
11
12
"github.com/stretchr/testify/require"
12
13
)
13
14
14
15
// NewTestDB is a helper function that creates an BBolt database for testing.
15
- func NewTestDB (t * testing.T , clock clock.Clock ) * BoltDB {
16
+ func NewTestDB (t * testing.T , clock clock.Clock ) FirewallDBs {
16
17
return NewTestDBFromPath (t , t .TempDir (), clock )
17
18
}
18
19
19
20
// NewTestDBFromPath is a helper function that creates a new BoltStore with a
20
21
// connection to an existing BBolt database for testing.
21
- func NewTestDBFromPath (t * testing.T , dbPath string , clock clock.Clock ) * BoltDB {
22
+ func NewTestDBFromPath (t * testing.T , dbPath string ,
23
+ clock clock.Clock ) FirewallDBs {
24
+
22
25
return newDBFromPathWithSessions (t , dbPath , nil , nil , clock )
23
26
}
24
27
25
28
// NewTestDBWithSessions creates a new test BoltDB Store with access to an
26
29
// existing sessions DB.
27
- func NewTestDBWithSessions (t * testing.T , sessStore SessionDB ,
28
- clock clock.Clock ) * BoltDB {
30
+ func NewTestDBWithSessions (t * testing.T , sessStore session. Store ,
31
+ clock clock.Clock ) FirewallDBs {
29
32
30
33
return newDBFromPathWithSessions (t , t .TempDir (), sessStore , nil , clock )
31
34
}
32
35
33
36
// NewTestDBWithSessionsAndAccounts creates a new test BoltDB Store with access
34
37
// to an existing sessions DB and accounts DB.
35
- func NewTestDBWithSessionsAndAccounts (t * testing.T , sessStore SessionDB ,
36
- acctStore AccountsDB , clock clock.Clock ) * BoltDB {
38
+ func NewTestDBWithSessionsAndAccounts (t * testing.T , sessStore session. Store ,
39
+ acctStore AccountsDB , clock clock.Clock ) FirewallDBs {
37
40
38
41
return newDBFromPathWithSessions (
39
42
t , t .TempDir (), sessStore , acctStore , clock ,
40
43
)
41
44
}
42
45
43
46
func newDBFromPathWithSessions (t * testing.T , dbPath string ,
44
- sessStore SessionDB , acctStore AccountsDB , clock clock.Clock ) * BoltDB {
47
+ sessStore session.Store , acctStore AccountsDB ,
48
+ clock clock.Clock ) FirewallDBs {
45
49
46
50
store , err := NewBoltDB (dbPath , DBFilename , sessStore , acctStore , clock )
47
51
require .NoError (t , err )
0 commit comments