Skip to content

Commit

Permalink
Merge pull request #5855 from filecoin-project/feat/0x5459/new_api_Re…
Browse files Browse the repository at this point in the history
…leaseDeals

feat: market: new api `ReleaseDeals`
  • Loading branch information
diwufeiwen authored Mar 23, 2023
2 parents db00ea0 + 9ac22ae commit c7cd25d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
6 changes: 4 additions & 2 deletions venus-shared/api/market/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ type IMarket interface {
UpdateDealStatus(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus market.PieceStatus, dealStatus storagemarket.StorageDealStatus) error //perm:write
GetDeals(ctx context.Context, miner address.Address, pageIndex, pageSize int) ([]*market.DealInfo, error) //perm:read
AssignUnPackedDeals(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) //perm:write
GetUnPackedDeals(ctx context.Context, miner address.Address, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) //perm:read
UpdateStorageDealStatus(ctx context.Context, dealProposalCid cid.Cid, state storagemarket.StorageDealStatus, pieceState market.PieceStatus) error //perm:write
// ReleaseDeals is used to release the deals that have been assigned by AssignUnPackedDeals method.
ReleaseDeals(ctx context.Context, miner address.Address, deals []abi.DealID) error //perm:write
GetUnPackedDeals(ctx context.Context, miner address.Address, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) //perm:read
UpdateStorageDealStatus(ctx context.Context, dealProposalCid cid.Cid, state storagemarket.StorageDealStatus, pieceState market.PieceStatus) error //perm:write
// market event
ResponseMarketEvent(ctx context.Context, resp *gateway.ResponseEvent) error //perm:read
ListenMarketEvent(ctx context.Context, policy *gateway.MarketRegisterPolicy) (<-chan *gateway.RequestEvent, error) //perm:read
Expand Down
19 changes: 19 additions & 0 deletions venus-shared/api/market/v1/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ curl http://<ip>:<port>/rpc/v1 -X POST -H "Content-Type: application/json" -H "
* [PiecesGetPieceInfo](#piecesgetpieceinfo)
* [PiecesListCidInfos](#pieceslistcidinfos)
* [PiecesListPieces](#pieceslistpieces)
* [ReleaseDeals](#releasedeals)
* [RemovePieceStorage](#removepiecestorage)
* [ResponseMarketEvent](#responsemarketevent)
* [SectorGetExpectedSealDuration](#sectorgetexpectedsealduration)
Expand Down Expand Up @@ -2346,6 +2347,24 @@ Response:
]
```

### ReleaseDeals
ReleaseDeals is used to release the deals that have been assigned by AssignUnPackedDeals method.


Perms: write

Inputs:
```json
[
"f01234",
[
5432
]
]
```

Response: `{}`

### RemovePieceStorage


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

4 changes: 4 additions & 0 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.

0 comments on commit c7cd25d

Please sign in to comment.