builder: Don't require specific NetAPI impl in StorageMinerAPI

This commit is contained in:
Łukasz Magiera 2021-06-29 14:24:46 +02:00
parent 49e26cce7d
commit 812dc266cf
5 changed files with 6 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -245,7 +245,7 @@ func ConfigCommon(cfg *config.Common, enableLibp2pNode bool) Option {
}), }),
ApplyIf(func(s *Settings) bool { return s.Base }), // apply only if Base has already been applied ApplyIf(func(s *Settings) bool { return s.Base }), // apply only if Base has already been applied
If(!enableLibp2pNode, If(!enableLibp2pNode,
Override(new(api.Net), From(new(api.NetStub))), Override(new(api.Net), new(api.NetStub)),
Override(new(api.Common), From(new(common.CommonAPI))), Override(new(api.Common), From(new(common.CommonAPI))),
), ),
If(enableLibp2pNode, If(enableLibp2pNode,

View File

@ -17,6 +17,7 @@ import (
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
"go.uber.org/fx"
"golang.org/x/xerrors" "golang.org/x/xerrors"
"github.com/filecoin-project/go-address" "github.com/filecoin-project/go-address"
@ -38,8 +39,6 @@ import (
"github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/markets/storageadapter"
"github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/miner"
"github.com/filecoin-project/lotus/node/impl/common"
"github.com/filecoin-project/lotus/node/impl/net"
"github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/storage" "github.com/filecoin-project/lotus/storage"
"github.com/filecoin-project/lotus/storage/sectorblocks" "github.com/filecoin-project/lotus/storage/sectorblocks"
@ -47,8 +46,10 @@ import (
) )
type StorageMinerAPI struct { type StorageMinerAPI struct {
common.CommonAPI fx.In
net.NetAPI
api.Common
api.Net
Full api.FullNode Full api.FullNode
LocalStore *stores.Local LocalStore *stores.Local