macaroons: convert to use new kvdb abstraction

This commit is contained in:
Olaoluwa Osuntokun
2020-01-09 18:45:26 -08:00
parent 557b930c5f
commit 852b2380a9
4 changed files with 28 additions and 25 deletions

View File

@@ -8,7 +8,7 @@ import (
"path"
"testing"
"github.com/coreos/bbolt"
"github.com/lightningnetwork/lnd/channeldb/kvdb"
"github.com/lightningnetwork/lnd/macaroons"
"google.golang.org/grpc/metadata"
"gopkg.in/macaroon-bakery.v2/bakery"
@@ -33,8 +33,9 @@ func setupTestRootKeyStorage(t *testing.T) string {
if err != nil {
t.Fatalf("Error creating temp dir: %v", err)
}
db, err := bbolt.Open(path.Join(tempDir, "macaroons.db"), 0600,
bbolt.DefaultOptions)
db, err := kvdb.Create(
kvdb.BoltBackendName, path.Join(tempDir, "macaroons.db"), true,
)
if err != nil {
t.Fatalf("Error opening store DB: %v", err)
}