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

refactor: market: rename OfflineDealImport to DealsImport #6012

Merged
merged 1 commit into from
Jun 12, 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 @@ -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