Skip to content

Commit

Permalink
builder: Don't require specific NetAPI impl in StorageMinerAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Jul 15, 2021
1 parent 49e26cc commit 812dc26
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
Binary file modified build/openrpc/full.json.gz
Binary file not shown.
Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
Binary file modified build/openrpc/worker.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion node/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
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))),
),
If(enableLibp2pNode,
Expand Down
9 changes: 5 additions & 4 deletions node/impl/storminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
"go.uber.org/fx"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
Expand All @@ -38,17 +39,17 @@ import (
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/markets/storageadapter"
"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/storage"
"github.com/filecoin-project/lotus/storage/sectorblocks"
sto "github.com/filecoin-project/specs-storage/storage"
)

type StorageMinerAPI struct {
common.CommonAPI
net.NetAPI
fx.In

api.Common
api.Net

Full api.FullNode
LocalStore *stores.Local
Expand Down

0 comments on commit 812dc26

Please sign in to comment.