Skip to content

Commit

Permalink
refactor: market: rename OfflineDealImport to DealsImport
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Jun 8, 2023
1 parent 26f810c commit 18ad821
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 196 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 @@ -57,8 +57,8 @@ type IMarket interface {
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
OfflineDealImport(ctx context.Context, deal market.MinerDeal) 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

DealsConsiderOnlineStorageDeals(context.Context, address.Address) (bool, error) //perm:read
DealsSetConsiderOnlineStorageDeals(context.Context, address.Address, bool) error //perm:write
Expand Down
160 changes: 81 additions & 79 deletions venus-shared/api/market/v0/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ curl http://<ip>:<port>/rpc/v0 -X POST -H "Content-Type: application/json" -H "
* [DealsConsiderOnlineStorageDeals](#dealsconsideronlinestoragedeals)
* [DealsConsiderUnverifiedStorageDeals](#dealsconsiderunverifiedstoragedeals)
* [DealsConsiderVerifiedStorageDeals](#dealsconsiderverifiedstoragedeals)
* [DealsImport](#dealsimport)
* [DealsImportData](#dealsimportdata)
* [DealsMaxProviderCollateralMultiplier](#dealsmaxprovidercollateralmultiplier)
* [DealsMaxPublishFee](#dealsmaxpublishfee)
Expand Down Expand Up @@ -89,7 +90,6 @@ curl http://<ip>:<port>/rpc/v0 -X POST -H "Content-Type: application/json" -H "
* [MessagerPushMessage](#messagerpushmessage)
* [MessagerWaitMessage](#messagerwaitmessage)
* [NetAddrsListen](#netaddrslisten)
* [OfflineDealImport](#offlinedealimport)
* [PaychVoucherList](#paychvoucherlist)
* [PiecesGetCIDInfo](#piecesgetcidinfo)
* [PiecesGetPieceInfo](#piecesgetpieceinfo)
Expand Down Expand Up @@ -559,6 +559,86 @@ Inputs:

Response: `true`

### DealsImport


Perms: admin

Inputs:
```json
[
[
{
"Proposal": {
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1032,
"VerifiedDeal": true,
"Client": "f01234",
"Provider": "f01234",
"Label": "",
"StartEpoch": 10101,
"EndEpoch": 10101,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ClientSignature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
},
"ProposalCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"AddFundsCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PublishCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"State": 42,
"PiecePath": "/some/path",
"PayloadSize": 42,
"MetadataPath": "/some/path",
"SlashEpoch": 10101,
"FastRetrieval": true,
"Message": "string value",
"FundsReserved": "0",
"Ref": {
"TransferType": "string value",
"Root": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1024,
"RawBlockSize": 42
},
"AvailableForRetrieval": true,
"DealID": 5432,
"CreationTime": "0001-01-01T00:00:00Z",
"TransferChannelId": {
"Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"ID": 3
},
"SectorNumber": 9,
"Offset": 1032,
"PieceStatus": "Undefine",
"InboundCAR": "string value",
"CreatedAt": 42,
"UpdatedAt": 42
}
]
]
```

Response: `{}`

### DealsImportData


Expand Down Expand Up @@ -2181,84 +2261,6 @@ Response:
}
```

### OfflineDealImport


Perms: admin

Inputs:
```json
[
{
"Proposal": {
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1032,
"VerifiedDeal": true,
"Client": "f01234",
"Provider": "f01234",
"Label": "",
"StartEpoch": 10101,
"EndEpoch": 10101,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ClientSignature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
},
"ProposalCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"AddFundsCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PublishCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"State": 42,
"PiecePath": "/some/path",
"PayloadSize": 42,
"MetadataPath": "/some/path",
"SlashEpoch": 10101,
"FastRetrieval": true,
"Message": "string value",
"FundsReserved": "0",
"Ref": {
"TransferType": "string value",
"Root": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1024,
"RawBlockSize": 42
},
"AvailableForRetrieval": true,
"DealID": 5432,
"CreationTime": "0001-01-01T00:00:00Z",
"TransferChannelId": {
"Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"ID": 3
},
"SectorNumber": 9,
"Offset": 1032,
"PieceStatus": "Undefine",
"InboundCAR": "string value",
"CreatedAt": 42,
"UpdatedAt": 42
}
]
```

Response: `{}`

### PaychVoucherList
Paych

Expand Down
28 changes: 14 additions & 14 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.

8 changes: 4 additions & 4 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 @@ -57,8 +57,8 @@ type IMarket interface {
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
OfflineDealImport(ctx context.Context, deal market.MinerDeal) 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

DealsConsiderOnlineStorageDeals(context.Context, address.Address) (bool, error) //perm:read
DealsSetConsiderOnlineStorageDeals(context.Context, address.Address, bool) error //perm:write
Expand Down
Loading

0 comments on commit 18ad821

Please sign in to comment.