Skip to content

Commit

Permalink
Merge pull request #6197 from filecoin-project/feat/market/import-dat…
Browse files Browse the repository at this point in the history
…a-by-uuid

feat: import data by uuid
  • Loading branch information
LinZexiao authored and simlecode committed Oct 31, 2023
1 parent a2234ee commit faaf3e5
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 27 deletions.
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
}

0 comments on commit faaf3e5

Please sign in to comment.