mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
Let all the NewTestDB functions return the V1Store interface type instead of pointers. Then add a manual skip in the TestGraphLoading test for any non-bbolt backend. We can remove this once all the methods used by the test have been implemented by the SQLStore. We only need the manual skip for this one test since it is the only one that doesnt use MakeGraphTest to init the graph db.
24 lines
500 B
Go
24 lines
500 B
Go
//go:build !test_db_sqlite && !test_db_postgres
|
|
|
|
package graphdb
|
|
|
|
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.TB) V1Store {
|
|
backend, backendCleanup, err := kvdb.GetTestBackend(t.TempDir(), "cgr")
|
|
require.NoError(t, err)
|
|
|
|
t.Cleanup(backendCleanup)
|
|
|
|
graphStore, err := NewKVStore(backend)
|
|
require.NoError(t, err)
|
|
|
|
return graphStore
|
|
}
|