mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-04 04:02:38 +02:00
multi: move payment related code into own package
This commit moves most of the code into its own package. It is the smallest code move possible without moving import cycles and keeping the changes to the code base as small as possible during refactor.
This commit is contained in:
23
payments/db/test_kvdb.go
Normal file
23
payments/db/test_kvdb.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package paymentsdb
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/lightningnetwork/lnd/kvdb"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// NewTestDB is a helper function that creates an BBolt database for testing.
|
||||
func NewTestDB(t *testing.T, opts ...OptionModifier) *KVPaymentsDB {
|
||||
backend, backendCleanup, err := kvdb.GetTestBackend(
|
||||
t.TempDir(), "kvPaymentDB",
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Cleanup(backendCleanup)
|
||||
|
||||
paymentDB, err := NewKVPaymentsDB(backend, opts...)
|
||||
require.NoError(t, err)
|
||||
|
||||
return paymentDB
|
||||
}
|
Reference in New Issue
Block a user