Skip to content

Commit 1771a00

Browse files
authored
Merge pull request #6471 from filecoin-project/feat/ddo-payload-cid
Feat/ddo payload cid
2 parents e7c4d65 + a366e5c commit 1771a00

File tree

5 files changed

+52
-11
lines changed

5 files changed

+52
-11
lines changed

venus-shared/api/market/v1/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ type IMarket interface {
198198
GetDirectDealByAllocationID(ctx context.Context, id types.AllocationId) (*market.DirectDeal, error) //perm:read
199199
ListDirectDeals(ctx context.Context, queryParams market.DirectDealQueryParams) ([]*market.DirectDeal, error) //perm:read
200200
UpdateDirectDealState(ctx context.Context, id uuid.UUID, state market.DirectDealState) error //perm:write
201+
UpdateDirectDealPayloadCID(ctx context.Context, id uuid.UUID, payloadCID cid.Cid) error //perm:write
201202

202203
UpdateStorageDealPayloadSize(ctx context.Context, dealProposal cid.Cid, payloadSize uint64) error //perm:write
203204

venus-shared/api/market/v1/method.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ curl http://<ip>:<port>/rpc/v1 -X POST -H "Content-Type: application/json" -H "
114114
* [SectorSetExpectedSealDuration](#sectorsetexpectedsealduration)
115115
* [UpdateDealOnPacking](#updatedealonpacking)
116116
* [UpdateDealStatus](#updatedealstatus)
117+
* [UpdateDirectDealPayloadCID](#updatedirectdealpayloadcid)
117118
* [UpdateDirectDealState](#updatedirectdealstate)
118119
* [UpdateStorageDealPayloadSize](#updatestoragedealpayloadsize)
119120
* [UpdateStorageDealStatus](#updatestoragedealstatus)
@@ -1049,6 +1050,9 @@ Response:
10491050
"Client": "f01234",
10501051
"Provider": "f01234",
10511052
"PayloadSize": 42,
1053+
"PayloadCID": {
1054+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
1055+
},
10521056
"State": 1,
10531057
"AllocationID": 42,
10541058
"ClaimID": 42,
@@ -1086,6 +1090,9 @@ Response:
10861090
"Client": "f01234",
10871091
"Provider": "f01234",
10881092
"PayloadSize": 42,
1093+
"PayloadCID": {
1094+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
1095+
},
10891096
"State": 1,
10901097
"AllocationID": 42,
10911098
"ClaimID": 42,
@@ -1218,12 +1225,12 @@ Inputs:
12181225
[
12191226
{
12201227
"SkipCommP": true,
1221-
"NoCopyCarFile": true,
1222-
"SkipGenerateIndex": true,
12231228
"DealParams": [
12241229
{
1225-
"FilePath": "string value",
12261230
"PayloadSize": 42,
1231+
"PayloadCID": {
1232+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
1233+
},
12271234
"DealUUID": "07070707-0707-0707-0707-070707070707",
12281235
"AllocationID": 42,
12291236
"PieceCID": {
@@ -1377,6 +1384,9 @@ Response:
13771384
"Client": "f01234",
13781385
"Provider": "f01234",
13791386
"PayloadSize": 42,
1387+
"PayloadCID": {
1388+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
1389+
},
13801390
"State": 1,
13811391
"AllocationID": 42,
13821392
"ClaimID": 42,
@@ -2870,6 +2880,23 @@ Inputs:
28702880

28712881
Response: `{}`
28722882

2883+
### UpdateDirectDealPayloadCID
2884+
2885+
2886+
Perms: write
2887+
2888+
Inputs:
2889+
```json
2890+
[
2891+
"07070707-0707-0707-0707-070707070707",
2892+
{
2893+
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
2894+
}
2895+
]
2896+
```
2897+
2898+
Response: `{}`
2899+
28732900
### UpdateDirectDealState
28742901

28752902

venus-shared/api/market/v1/mock/mock_imarket.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

venus-shared/api/market/v1/proxy_gen.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

venus-shared/types/market/storage.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ type DirectDeal struct {
190190
Provider address.Address
191191

192192
PayloadSize uint64
193+
PayloadCID cid.Cid
193194

194195
State DirectDealState
195196

@@ -210,19 +211,13 @@ type DirectDeal struct {
210211

211212
type DirectDealParams struct {
212213
// Commp will not be calculated and verified
213-
SkipCommP bool
214-
// not copy car file to piece storage
215-
NoCopyCarFile bool
216-
// skip generate index
217-
SkipGenerateIndex bool
218-
214+
SkipCommP bool
219215
DealParams []DirectDealParam
220216
}
221217

222218
type DirectDealParam struct {
223-
// FilePath and PayloadSize cannot both be empty
224-
FilePath string
225219
PayloadSize uint64
220+
PayloadCID cid.Cid
226221

227222
DealUUID uuid.UUID
228223
AllocationID uint64

0 commit comments

Comments
 (0)