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: import data by uuid #6197

Merged
merged 1 commit into from
Oct 19, 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
2 changes: 1 addition & 1 deletion venus-shared/api/market/v0/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type IMarket interface {
PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) //perm:read
PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) //perm:read

DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string, skipCommP bool) error //perm:admin
DealsImportData(ctx context.Context, ref market.ImportDataRef, skipCommP bool) error //perm:admin
DealsBatchImportData(ctx context.Context, refs market.ImportDataRefs) ([]*market.ImportDataResult, error) //perm:admin
DealsImport(ctx context.Context, deals []market.MinerDeal) error //perm:admin

Expand Down
12 changes: 7 additions & 5 deletions venus-shared/api/market/v0/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ Inputs:
"ProposalCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"UUID": "07070707-0707-0707-0707-070707070707",
"File": "string value"
}
],
Expand All @@ -468,9 +469,7 @@ Response:
```json
[
{
"ProposalCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Target": "string value",
"Message": "string value"
}
]
Expand Down Expand Up @@ -650,9 +649,12 @@ Inputs:
```json
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
"ProposalCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"UUID": "07070707-0707-0707-0707-070707070707",
"File": "string value"
},
"string value",
true
]
```
Expand Down
8 changes: 4 additions & 4 deletions venus-shared/api/market/v0/mock/mock_imarket.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/market/v0/proxy_gen.go

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

2 changes: 1 addition & 1 deletion venus-shared/api/market/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type IMarket interface {
PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) //perm:read
PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) //perm:read

DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string, skipCommP bool) error //perm:admin
DealsImportData(ctx context.Context, ref market.ImportDataRef, skipCommP bool) error //perm:admin
DealsBatchImportData(ctx context.Context, refs market.ImportDataRefs) ([]*market.ImportDataResult, error) //perm:admin
DealsImport(ctx context.Context, deals []*market.MinerDeal) error //perm:admin

Expand Down
12 changes: 7 additions & 5 deletions venus-shared/api/market/v1/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ Inputs:
"ProposalCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"UUID": "07070707-0707-0707-0707-070707070707",
"File": "string value"
}
],
Expand All @@ -469,9 +470,7 @@ Response:
```json
[
{
"ProposalCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Target": "string value",
"Message": "string value"
}
]
Expand Down Expand Up @@ -651,9 +650,12 @@ Inputs:
```json
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
"ProposalCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"UUID": "07070707-0707-0707-0707-070707070707",
"File": "string value"
},
"string value",
true
]
```
Expand Down
8 changes: 4 additions & 4 deletions venus-shared/api/market/v1/mock/mock_imarket.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/market/v1/proxy_gen.go

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

4 changes: 3 additions & 1 deletion venus-shared/types/market/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ type StorageDealQueryParams struct {

type ImportDataRef struct {
ProposalCID cid.Cid
UUID uuid.UUID
File string
}

Expand All @@ -142,7 +143,8 @@ type ImportDataRefs struct {
}

type ImportDataResult struct {
ProposalCID cid.Cid
// Target may deal proposal cid or deal uuid
Target string
// deal import failed
Message string
}
Loading