Skip to content

Commit

Permalink
feat: refactor market api of venus-gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
diwufeiwen committed Jan 10, 2023
1 parent c4bf086 commit 7344e35
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 32 deletions.
6 changes: 2 additions & 4 deletions venus-devtool/api-gen/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ import (
"strings"
"time"

"github.com/filecoin-project/go-state-types/actors"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-fil-markets/filestore"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/venus/venus-shared/types/market"
auuid "github.com/google/uuid"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
Expand All @@ -37,6 +35,7 @@ import (
"github.com/filecoin-project/venus/pkg/constants"
"github.com/filecoin-project/venus/venus-shared/api/chain"
"github.com/filecoin-project/venus/venus-shared/types"
"github.com/filecoin-project/venus/venus-shared/types/market"
"github.com/filecoin-project/venus/venus-shared/types/market/client"
"github.com/filecoin-project/venus/venus-shared/types/messager"
"github.com/filecoin-project/venus/venus-shared/types/wallet"
Expand Down Expand Up @@ -323,7 +322,6 @@ func exampleStruct(method string, t, parent reflect.Type) interface{} {
}

if strings.Title(f.Name) == f.Name {
fmt.Println(f.Name)
ns.Field(i).Set(reflect.ValueOf(ExampleValue(method, f.Type, t)))
}
}
Expand Down
8 changes: 3 additions & 5 deletions venus-shared/api/gateway/v2/market_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-storage/storage"

"github.com/ipfs/go-cid"

"github.com/filecoin-project/venus/venus-shared/types"
Expand All @@ -19,9 +17,9 @@ type IMarketEvent interface {
}

type IMarketClient interface {
ListMarketConnectionsState(ctx context.Context) ([]gtypes.MarketConnectionState, error) //perm:admin
IsUnsealed(ctx context.Context, miner address.Address, pieceCid cid.Cid, sector storage.SectorRef, offset types.PaddedByteIndex, size abi.PaddedPieceSize) (bool, error) //perm:admin
SectorsUnsealPiece(ctx context.Context, miner address.Address, pieceCid cid.Cid, sector storage.SectorRef, offset types.PaddedByteIndex, size abi.PaddedPieceSize, dest string) error //perm:admin
ListMarketConnectionsState(ctx context.Context) ([]gtypes.MarketConnectionState, error) //perm:admin
IsUnsealed(ctx context.Context, miner address.Address, pieceCid cid.Cid, sectorNumber abi.SectorNumber, offset types.PaddedByteIndex, size abi.PaddedPieceSize) (bool, error) //perm:admin
SectorsUnsealPiece(ctx context.Context, miner address.Address, pieceCid cid.Cid, sectorNumber abi.SectorNumber, offset types.PaddedByteIndex, size abi.PaddedPieceSize, dest string) error //perm:admin
}

type IMarketServiceProvider interface {
Expand Down
16 changes: 2 additions & 14 deletions venus-shared/api/gateway/v2/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,7 @@ Inputs:
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"ID": {
"Miner": 1000,
"Number": 9
},
"ProofType": 8
},
9,
10,
1032
]
Expand Down Expand Up @@ -116,13 +110,7 @@ Inputs:
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
{
"ID": {
"Miner": 1000,
"Number": 9
},
"ProofType": 8
},
9,
10,
1032,
"string value"
Expand Down
5 changes: 2 additions & 3 deletions venus-shared/api/gateway/v2/mock/mock_igateway.go

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

11 changes: 5 additions & 6 deletions venus-shared/api/gateway/v2/proxy_gen.go

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

0 comments on commit 7344e35

Please sign in to comment.