Move KeyStore into separate module

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2019-07-18 18:10:53 +02:00
parent 5ee7ba8420
commit 935e4e8da7
2 changed files with 6 additions and 5 deletions

View File

@ -209,10 +209,6 @@ func Repo(r repo.Repo) Option {
if err != nil { if err != nil {
return Error(err) return Error(err)
} }
kstore, err := lr.KeyStore()
if err != nil {
return Error(err)
}
return Options( return Options(
Config(cfg), Config(cfg),
@ -228,7 +224,7 @@ func Repo(r repo.Repo) Option {
Override(new(ci.PubKey), ci.PrivKey.GetPublic), Override(new(ci.PubKey), ci.PrivKey.GetPublic),
Override(new(peer.ID), peer.IDFromPublicKey), Override(new(peer.ID), peer.IDFromPublicKey),
Override(new(types.KeyStore), kstore), Override(new(types.KeyStore), modules.KeyStore),
) )
} }

View File

@ -23,6 +23,7 @@ import (
"go.uber.org/fx" "go.uber.org/fx"
"github.com/filecoin-project/go-lotus/chain" "github.com/filecoin-project/go-lotus/chain"
"github.com/filecoin-project/go-lotus/chain/types"
"github.com/filecoin-project/go-lotus/node/modules/helpers" "github.com/filecoin-project/go-lotus/node/modules/helpers"
"github.com/filecoin-project/go-lotus/node/repo" "github.com/filecoin-project/go-lotus/node/repo"
) )
@ -65,6 +66,10 @@ func LockedRepo(lr repo.LockedRepo) func(lc fx.Lifecycle) repo.LockedRepo {
} }
} }
func KeyStore(lr repo.LockedRepo) (types.KeyStore, error) {
return lr.KeyStore()
}
func Datastore(r repo.LockedRepo) (datastore.Batching, error) { func Datastore(r repo.LockedRepo) (datastore.Batching, error) {
return r.Datastore("/metadata") return r.Datastore("/metadata")
} }