Skip to content

Commit

Permalink
v1.24.0-rc4-gw
Browse files Browse the repository at this point in the history
  • Loading branch information
lazavikmaria committed Nov 6, 2023
1 parent ee0152f commit d3a9b0f
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/api_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import (
// * Generate openrpc blobs

type Gateway interface {
StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error)
StateMarketParticipants(context.Context, types.TipSetKey) (map[string]MarketBalance, error)
MpoolPending(context.Context, types.TipSetKey) ([]*types.SignedMessage, error)
ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error)
MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*MiningBaseInfo, error)
Expand Down
26 changes: 26 additions & 0 deletions api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/v0api/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import (
// * Generate openrpc blobs

type Gateway interface {
StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error)
StateMarketParticipants(context.Context, types.TipSetKey) (map[string]api.MarketBalance, error)
MpoolPending(context.Context, types.TipSetKey) ([]*types.SignedMessage, error)
ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error)
MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error)
Expand Down
28 changes: 28 additions & 0 deletions api/v0api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gateway/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const (
// TargetAPI defines the API methods that the Node depends on
// (to make it easy to mock for tests)
type TargetAPI interface {
StateMarketParticipants(context.Context, types.TipSetKey) (map[string]api.MarketBalance, error)
MpoolPending(context.Context, types.TipSetKey) ([]*types.SignedMessage, error)
ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error)
MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error)
Expand Down
10 changes: 10 additions & 0 deletions gateway/proxy_fil.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ import (
"github.com/filecoin-project/lotus/node/modules/dtypes"
)

func (gw *Node) StateMarketParticipants(ctx context.Context, tsk types.TipSetKey) (map[string]api.MarketBalance, error) {
if err := gw.limit(ctx, stateRateLimitTokens); err != nil {
return nil, err
}
if err := gw.checkTipsetKey(ctx, tsk); err != nil {
return nil, err
}
return gw.target.StateMarketParticipants(ctx, tsk)
}

func (gw *Node) MpoolPending(ctx context.Context, tsk types.TipSetKey) ([]*types.SignedMessage, error) {
if err := gw.limit(ctx, stateRateLimitTokens); err != nil {
return nil, err
Expand Down

0 comments on commit d3a9b0f

Please sign in to comment.