Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add unseal state / 增加了 unseal 的状态类型 #5990

Merged
merged 1 commit into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions venus-devtool/api-gen/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"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/gateway"
"github.com/filecoin-project/venus/venus-shared/types/market"
auuid "github.com/google/uuid"
"github.com/ipfs/go-cid"
Expand Down Expand Up @@ -298,6 +299,8 @@ func init() {
percent := types.Percent(123)
addExample(percent)
addExample(&percent)
addExample(gateway.UnsealStateFinished)
addExample(types.UnpaddedByteIndex(0))
}

func ExampleValue(method string, t, parent reflect.Type) interface{} {
Expand Down
4 changes: 2 additions & 2 deletions venus-shared/api/gateway/v2/market_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type IMarketEvent interface {
}

type IMarketClient interface {
ListMarketConnectionsState(ctx context.Context) ([]gtypes.MarketConnectionState, error) //perm:admin
SectorsUnsealPiece(ctx context.Context, miner address.Address, pieceCid cid.Cid, sid abi.SectorNumber, offset types.PaddedByteIndex, size abi.PaddedPieceSize, dest string) error //perm:admin
ListMarketConnectionsState(ctx context.Context) ([]gtypes.MarketConnectionState, error) //perm:admin
SectorsUnsealPiece(ctx context.Context, miner address.Address, pieceCid cid.Cid, sid abi.SectorNumber, offset types.UnpaddedByteIndex, size abi.UnpaddedPieceSize, dest string) (gtypes.UnsealState, error) //perm:admin
}

type IMarketServiceProvider interface {
Expand Down
6 changes: 3 additions & 3 deletions venus-shared/api/gateway/v2/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ Inputs:
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
9,
10,
1032,
0,
1024,
"string value"
]
```

Response: `{}`
Response: `"finished"`

## MarketServiceProvider

Expand Down
7 changes: 4 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.

6 changes: 3 additions & 3 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.

14 changes: 11 additions & 3 deletions venus-shared/types/gateway/market_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ type UnsealRequest struct {
PieceCid cid.Cid
Miner address.Address
Sid abi.SectorNumber
Offset types.PaddedByteIndex
Size abi.PaddedPieceSize
Offset types.UnpaddedByteIndex
Size abi.UnpaddedPieceSize
Dest string
}

type UnsealResponse struct{}
type UnsealState string

const (
UnsealStateSet UnsealState = "set_up"
UnsealStateFinished UnsealState = "finished"
UnsealStateFailed UnsealState = "failed"
UnsealStateUnsealing UnsealState = "unsealing"
UnsealStateUploading UnsealState = "uploading"
)

type MarketConnectionState struct {
Addr address.Address
Expand Down