fix paychmgr constructor to take an easier to implement interface
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user