multi: make macaroon DB remote compatible
The macaroon root keys should also be stored to the remote database if a replicated backend such as etcd is used. This commit refactors the macaroons service and wallet unlocker to accept a kvdb backend directly instead of creating the bolt instance automatically.
This commit is contained in:
8 files changed
+121
-104
No files matched your search
@@ -54,6 +54,7 @@ func openTestStore(t *testing.T, tempDir string) (func(),
|
||||
|
||||
cleanup := func() {
|
||||
_ = store.Close()
|
||||
_ = db.Close()
|
||||
}
|
||||
|
||||
return cleanup, store
|
||||
@@ -108,6 +109,7 @@ func TestStore(t *testing.T) {
|
||||
require.Equal(t, macaroons.ErrAlreadyUnlocked, err)
|
||||
|
||||
_ = store.Close()
|
||||
_ = store.Backend.Close()
|
||||
|
||||
// Between here and the re-opening of the store, it's possible to get
|
||||
// a double-close, but that's not such a big deal since the tests will
|
||||
@@ -206,6 +208,8 @@ func TestStoreChangePassword(t *testing.T) {
|
||||
// after closing.
|
||||
err = store.Close()
|
||||
require.NoError(t, err)
|
||||
err = store.Backend.Close()
|
||||
require.NoError(t, err)
|
||||
|
||||
err = store.CreateUnlock(&newPw)
|
||||
require.Error(t, err)
|
||||
|
||||
Reference in new issue
Block a user