• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 17215686384

25 Aug 2025 05:13PM UTC coverage: 56.933% (-0.4%) from 57.321%
17215686384

Pull #9147

github

web-flow
Merge 84ace3fea into 0c2f045f5
Pull Request #9147: [Part 1|3] Introduce SQL Payment schema into LND

58 of 1339 new or added lines in 9 files covered. (4.33%)

42 existing lines in 11 files now uncovered.

99232 of 174295 relevant lines covered (56.93%)

1.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/payments/db/test_kvdb.go
1
//go:build !test_db_sqlite && !test_db_postgres
2

3
package paymentsdb
4

5
import (
6
        "testing"
7

8
        "github.com/lightningnetwork/lnd/kvdb"
9
        "github.com/stretchr/testify/require"
10
)
11

12
// NewTestDB is a helper function that creates an BBolt database for testing.
NEW
13
func NewTestDB(t *testing.T, opts ...StoreOptionModifier) DB {
×
14
        backend, backendCleanup, err := kvdb.GetTestBackend(
×
15
                t.TempDir(), "paymentsDB",
×
16
        )
×
17
        require.NoError(t, err)
×
18

×
19
        t.Cleanup(backendCleanup)
×
20

×
21
        paymentDB, err := NewKVStore(backend, opts...)
×
22
        require.NoError(t, err)
×
23

×
24
        return paymentDB
×
25
}
×
26

27
// NewKVTestDB is a helper function that creates an BBolt database for testing
28
// and there is no need to convert the interface to the KVStore because for
29
// some unit tests we still need access to the kvdb interface.
NEW
30
func NewKVTestDB(t *testing.T, opts ...StoreOptionModifier) *KVStore {
×
31
        backend, backendCleanup, err := kvdb.GetTestBackend(
×
32
                t.TempDir(), "kvPaymentDB",
×
33
        )
×
34
        require.NoError(t, err)
×
35

×
36
        t.Cleanup(backendCleanup)
×
37

×
38
        paymentDB, err := NewKVStore(backend, opts...)
×
39
        require.NoError(t, err)
×
40

×
41
        return paymentDB
×
42
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc