fix paychmgr constructor to take an easier to implement interface

This commit is contained in:
whyrusleeping
2021-03-12 00:39:20 -08:00
parent e0b650d4ec
commit cbc7f1c244
3 changed files with 13 additions and 14 deletions
+1
View File
@@ -308,6 +308,7 @@ var ChainNode = Options(
Override(new(api.WalletAPI), From(new(wallet.MultiWallet))),
// Service: Payment channels
Override(new(paychmgr.PaychAPI), new(modules.PaychAPI)),
Override(new(*paychmgr.Store), modules.NewPaychStore),
Override(new(*paychmgr.Manager), modules.NewManager),
Override(HandlePaymentChannelManagerKey, modules.HandlePaychManager),
+8
View File
@@ -4,6 +4,7 @@ import (
"context"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/node/impl/full"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/modules/helpers"
"github.com/filecoin-project/lotus/paychmgr"
@@ -24,6 +25,13 @@ func NewPaychStore(ds dtypes.MetadataDS) *paychmgr.Store {
return paychmgr.NewStore(ds)
}
type PaychAPI struct {
fx.In
full.MpoolAPI
full.StateAPI
}
// HandlePaychManager is called by dependency injection to set up hooks
func HandlePaychManager(lc fx.Lifecycle, pm *paychmgr.Manager) {
lc.Append(fx.Hook{