feat: lite-mode - check that gateway API implements required chain, mpool, state methods

This commit is contained in:
Dirk McCormick
2020-10-09 11:43:03 +02:00
parent 2719adc1b1
commit be09a8a00a
7 changed files with 17 additions and 20 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ func (a *ChainAPI) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, e
return a.Chain.SubHeadChanges(ctx), nil
}
func (m *ChainModule) ChainHead(ctx context.Context) (*types.TipSet, error) {
func (m *ChainModule) ChainHead(context.Context) (*types.TipSet, error) {
return m.Chain.GetHeaviestTipSet(), nil
}
+3 -6
View File
@@ -4,19 +4,16 @@ import (
"context"
"encoding/json"
"github.com/filecoin-project/lotus/chain/messagepool"
"github.com/filecoin-project/lotus/chain/messagesigner"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/go-address"
"github.com/ipfs/go-cid"
"go.uber.org/fx"
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/messagepool"
"github.com/filecoin-project/lotus/chain/messagesigner"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
type MpoolModuleAPI interface {
+3 -5
View File
@@ -3,8 +3,6 @@ package full
import (
"context"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-address"
@@ -25,8 +23,8 @@ import (
type MsigAPI struct {
fx.In
StateManagerAPI stmgr.StateManagerAPI
MpoolAPI MpoolAPI
StateAPI StateAPI
MpoolAPI MpoolAPI
}
func (a *MsigAPI) messageBuilder(ctx context.Context, from address.Address) (multisig.MessageBuilder, error) {
@@ -153,7 +151,7 @@ func (a *MsigAPI) msigApproveOrCancel(ctx context.Context, operation api.MsigPro
}
if proposer.Protocol() != address.ID {
proposerID, err := a.StateManagerAPI.LookupID(ctx, proposer, nil)
proposerID, err := a.StateAPI.StateLookupID(ctx, proposer, types.EmptyTSK)
if err != nil {
return cid.Undef, err
}
+2 -2
View File
@@ -19,8 +19,8 @@ import (
type WalletAPI struct {
fx.In
stmgr.StateManagerAPI
Wallet *wallet.Wallet
StateManagerAPI stmgr.StateManagerAPI
Wallet *wallet.Wallet
}
func (a *WalletAPI) WalletNew(ctx context.Context, typ crypto.SigType) (address.Address, error) {