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:
26 files changed
+1075
-948
No files matched your search
@@ -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