From d8ba39cc8a85226d9fa1cd10ac635672879f8c40 Mon Sep 17 00:00:00 2001 From: simlecode <69969590+simlecode@users.noreply.github.com> Date: Thu, 8 Jun 2023 13:39:33 +0800 Subject: [PATCH] refactor: market: rename OfflineDealImport to DealsImport --- venus-shared/api/market/v0/api.go | 2 +- venus-shared/api/market/v0/method.md | 160 +++++++++--------- .../api/market/v0/mock/mock_imarket.go | 28 +-- venus-shared/api/market/v0/proxy_gen.go | 8 +- venus-shared/api/market/v1/api.go | 2 +- venus-shared/api/market/v1/method.md | 160 +++++++++--------- .../api/market/v1/mock/mock_imarket.go | 28 +-- venus-shared/api/market/v1/proxy_gen.go | 8 +- 8 files changed, 200 insertions(+), 196 deletions(-) diff --git a/venus-shared/api/market/v0/api.go b/venus-shared/api/market/v0/api.go index 13bf9a7457..73b2566c97 100644 --- a/venus-shared/api/market/v0/api.go +++ b/venus-shared/api/market/v0/api.go @@ -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 diff --git a/venus-shared/api/market/v0/method.md b/venus-shared/api/market/v0/method.md index 4975e93047..c101be2e3e 100644 --- a/venus-shared/api/market/v0/method.md +++ b/venus-shared/api/market/v0/method.md @@ -29,6 +29,7 @@ curl http://:/rpc/v0 -X POST -H "Content-Type: application/json" -H " * [DealsConsiderOnlineStorageDeals](#dealsconsideronlinestoragedeals) * [DealsConsiderUnverifiedStorageDeals](#dealsconsiderunverifiedstoragedeals) * [DealsConsiderVerifiedStorageDeals](#dealsconsiderverifiedstoragedeals) + * [DealsImport](#dealsimport) * [DealsImportData](#dealsimportdata) * [DealsMaxProviderCollateralMultiplier](#dealsmaxprovidercollateralmultiplier) * [DealsMaxPublishFee](#dealsmaxpublishfee) @@ -89,7 +90,6 @@ curl http://:/rpc/v0 -X POST -H "Content-Type: application/json" -H " * [MessagerPushMessage](#messagerpushmessage) * [MessagerWaitMessage](#messagerwaitmessage) * [NetAddrsListen](#netaddrslisten) - * [OfflineDealImport](#offlinedealimport) * [PaychVoucherList](#paychvoucherlist) * [PiecesGetCIDInfo](#piecesgetcidinfo) * [PiecesGetPieceInfo](#piecesgetpieceinfo) @@ -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 @@ -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 diff --git a/venus-shared/api/market/v0/mock/mock_imarket.go b/venus-shared/api/market/v0/mock/mock_imarket.go index 3d8414e632..080057837c 100644 --- a/venus-shared/api/market/v0/mock/mock_imarket.go +++ b/venus-shared/api/market/v0/mock/mock_imarket.go @@ -372,6 +372,20 @@ func (mr *MockIMarketMockRecorder) DealsConsiderVerifiedStorageDeals(arg0, arg1 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsConsiderVerifiedStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsConsiderVerifiedStorageDeals), arg0, arg1) } +// DealsImport mocks base method. +func (m *MockIMarket) DealsImport(arg0 context.Context, arg1 []market.MinerDeal) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsImport", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsImport indicates an expected call of DealsImport. +func (mr *MockIMarketMockRecorder) DealsImport(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsImport", reflect.TypeOf((*MockIMarket)(nil).DealsImport), arg0, arg1) +} + // DealsImportData mocks base method. func (m *MockIMarket) DealsImportData(arg0 context.Context, arg1 cid.Cid, arg2 string, arg3 bool) error { m.ctrl.T.Helper() @@ -1247,20 +1261,6 @@ func (mr *MockIMarketMockRecorder) NetAddrsListen(arg0 interface{}) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetAddrsListen", reflect.TypeOf((*MockIMarket)(nil).NetAddrsListen), arg0) } -// OfflineDealImport mocks base method. -func (m *MockIMarket) OfflineDealImport(arg0 context.Context, arg1 market.MinerDeal) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OfflineDealImport", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// OfflineDealImport indicates an expected call of OfflineDealImport. -func (mr *MockIMarketMockRecorder) OfflineDealImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OfflineDealImport", reflect.TypeOf((*MockIMarket)(nil).OfflineDealImport), arg0, arg1) -} - // PaychVoucherList mocks base method. func (m *MockIMarket) PaychVoucherList(arg0 context.Context, arg1 address.Address) ([]*paych.SignedVoucher, error) { m.ctrl.T.Helper() diff --git a/venus-shared/api/market/v0/proxy_gen.go b/venus-shared/api/market/v0/proxy_gen.go index e017aa125c..4037fd4828 100644 --- a/venus-shared/api/market/v0/proxy_gen.go +++ b/venus-shared/api/market/v0/proxy_gen.go @@ -44,6 +44,7 @@ type IMarketStruct struct { DealsConsiderOnlineStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` DealsConsiderUnverifiedStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` DealsConsiderVerifiedStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` + DealsImport func(ctx context.Context, deals []market.MinerDeal) error `perm:"admin"` DealsImportData func(ctx context.Context, dealPropCid cid.Cid, file string, skipCommP bool) error `perm:"admin"` DealsMaxProviderCollateralMultiplier func(context.Context, address.Address) (uint64, error) `perm:"read"` DealsMaxPublishFee func(context.Context, address.Address) (types.FIL, error) `perm:"read"` @@ -104,7 +105,6 @@ type IMarketStruct struct { MessagerPushMessage func(ctx context.Context, msg *types.Message, meta *types.MessageSendSpec) (cid.Cid, error) `perm:"write"` MessagerWaitMessage func(ctx context.Context, mid cid.Cid) (*types.MsgLookup, error) `perm:"read"` NetAddrsListen func(context.Context) (peer.AddrInfo, error) `perm:"read"` - OfflineDealImport func(ctx context.Context, deal market.MinerDeal) error `perm:"admin"` PaychVoucherList func(ctx context.Context, pch address.Address) ([]*paych.SignedVoucher, error) `perm:"read"` PiecesGetCIDInfo func(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) `perm:"read"` PiecesGetPieceInfo func(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) `perm:"read"` @@ -187,6 +187,9 @@ func (s *IMarketStruct) DealsConsiderUnverifiedStorageDeals(p0 context.Context, func (s *IMarketStruct) DealsConsiderVerifiedStorageDeals(p0 context.Context, p1 address.Address) (bool, error) { return s.Internal.DealsConsiderVerifiedStorageDeals(p0, p1) } +func (s *IMarketStruct) DealsImport(p0 context.Context, p1 []market.MinerDeal) error { + return s.Internal.DealsImport(p0, p1) +} func (s *IMarketStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string, p3 bool) error { return s.Internal.DealsImportData(p0, p1, p2, p3) } @@ -365,9 +368,6 @@ func (s *IMarketStruct) MessagerWaitMessage(p0 context.Context, p1 cid.Cid) (*ty func (s *IMarketStruct) NetAddrsListen(p0 context.Context) (peer.AddrInfo, error) { return s.Internal.NetAddrsListen(p0) } -func (s *IMarketStruct) OfflineDealImport(p0 context.Context, p1 market.MinerDeal) error { - return s.Internal.OfflineDealImport(p0, p1) -} func (s *IMarketStruct) PaychVoucherList(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) { return s.Internal.PaychVoucherList(p0, p1) } diff --git a/venus-shared/api/market/v1/api.go b/venus-shared/api/market/v1/api.go index 7758d7bcb6..8368e28a6c 100644 --- a/venus-shared/api/market/v1/api.go +++ b/venus-shared/api/market/v1/api.go @@ -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 diff --git a/venus-shared/api/market/v1/method.md b/venus-shared/api/market/v1/method.md index bca870d763..1a5f90bacb 100644 --- a/venus-shared/api/market/v1/method.md +++ b/venus-shared/api/market/v1/method.md @@ -29,6 +29,7 @@ curl http://:/rpc/v1 -X POST -H "Content-Type: application/json" -H " * [DealsConsiderOnlineStorageDeals](#dealsconsideronlinestoragedeals) * [DealsConsiderUnverifiedStorageDeals](#dealsconsiderunverifiedstoragedeals) * [DealsConsiderVerifiedStorageDeals](#dealsconsiderverifiedstoragedeals) + * [DealsImport](#dealsimport) * [DealsImportData](#dealsimportdata) * [DealsMaxProviderCollateralMultiplier](#dealsmaxprovidercollateralmultiplier) * [DealsMaxPublishFee](#dealsmaxpublishfee) @@ -89,7 +90,6 @@ curl http://:/rpc/v1 -X POST -H "Content-Type: application/json" -H " * [MessagerPushMessage](#messagerpushmessage) * [MessagerWaitMessage](#messagerwaitmessage) * [NetAddrsListen](#netaddrslisten) - * [OfflineDealImport](#offlinedealimport) * [PaychVoucherList](#paychvoucherlist) * [PiecesGetCIDInfo](#piecesgetcidinfo) * [PiecesGetPieceInfo](#piecesgetpieceinfo) @@ -560,6 +560,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 @@ -2182,84 +2262,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 diff --git a/venus-shared/api/market/v1/mock/mock_imarket.go b/venus-shared/api/market/v1/mock/mock_imarket.go index 408dcf372e..f5e86065f7 100644 --- a/venus-shared/api/market/v1/mock/mock_imarket.go +++ b/venus-shared/api/market/v1/mock/mock_imarket.go @@ -372,6 +372,20 @@ func (mr *MockIMarketMockRecorder) DealsConsiderVerifiedStorageDeals(arg0, arg1 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsConsiderVerifiedStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsConsiderVerifiedStorageDeals), arg0, arg1) } +// DealsImport mocks base method. +func (m *MockIMarket) DealsImport(arg0 context.Context, arg1 []*market.MinerDeal) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsImport", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsImport indicates an expected call of DealsImport. +func (mr *MockIMarketMockRecorder) DealsImport(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsImport", reflect.TypeOf((*MockIMarket)(nil).DealsImport), arg0, arg1) +} + // DealsImportData mocks base method. func (m *MockIMarket) DealsImportData(arg0 context.Context, arg1 cid.Cid, arg2 string, arg3 bool) error { m.ctrl.T.Helper() @@ -1247,20 +1261,6 @@ func (mr *MockIMarketMockRecorder) NetAddrsListen(arg0 interface{}) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetAddrsListen", reflect.TypeOf((*MockIMarket)(nil).NetAddrsListen), arg0) } -// OfflineDealImport mocks base method. -func (m *MockIMarket) OfflineDealImport(arg0 context.Context, arg1 market.MinerDeal) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OfflineDealImport", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// OfflineDealImport indicates an expected call of OfflineDealImport. -func (mr *MockIMarketMockRecorder) OfflineDealImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OfflineDealImport", reflect.TypeOf((*MockIMarket)(nil).OfflineDealImport), arg0, arg1) -} - // PaychVoucherList mocks base method. func (m *MockIMarket) PaychVoucherList(arg0 context.Context, arg1 address.Address) ([]*paych.SignedVoucher, error) { m.ctrl.T.Helper() diff --git a/venus-shared/api/market/v1/proxy_gen.go b/venus-shared/api/market/v1/proxy_gen.go index cf70289de8..00ecffda2f 100644 --- a/venus-shared/api/market/v1/proxy_gen.go +++ b/venus-shared/api/market/v1/proxy_gen.go @@ -44,6 +44,7 @@ type IMarketStruct struct { DealsConsiderOnlineStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` DealsConsiderUnverifiedStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` DealsConsiderVerifiedStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` + DealsImport func(ctx context.Context, deals []*market.MinerDeal) error `perm:"admin"` DealsImportData func(ctx context.Context, dealPropCid cid.Cid, file string, skipCommP bool) error `perm:"admin"` DealsMaxProviderCollateralMultiplier func(context.Context, address.Address) (uint64, error) `perm:"read"` DealsMaxPublishFee func(context.Context, address.Address) (types.FIL, error) `perm:"read"` @@ -104,7 +105,6 @@ type IMarketStruct struct { MessagerPushMessage func(ctx context.Context, msg *types.Message, meta *types.MessageSendSpec) (cid.Cid, error) `perm:"write"` MessagerWaitMessage func(ctx context.Context, mid cid.Cid) (*types.MsgLookup, error) `perm:"read"` NetAddrsListen func(context.Context) (peer.AddrInfo, error) `perm:"read"` - OfflineDealImport func(ctx context.Context, deal market.MinerDeal) error `perm:"admin"` PaychVoucherList func(ctx context.Context, pch address.Address) ([]*paych.SignedVoucher, error) `perm:"read"` PiecesGetCIDInfo func(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) `perm:"read"` PiecesGetPieceInfo func(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) `perm:"read"` @@ -188,6 +188,9 @@ func (s *IMarketStruct) DealsConsiderUnverifiedStorageDeals(p0 context.Context, func (s *IMarketStruct) DealsConsiderVerifiedStorageDeals(p0 context.Context, p1 address.Address) (bool, error) { return s.Internal.DealsConsiderVerifiedStorageDeals(p0, p1) } +func (s *IMarketStruct) DealsImport(p0 context.Context, p1 []*market.MinerDeal) error { + return s.Internal.DealsImport(p0, p1) +} func (s *IMarketStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string, p3 bool) error { return s.Internal.DealsImportData(p0, p1, p2, p3) } @@ -366,9 +369,6 @@ func (s *IMarketStruct) MessagerWaitMessage(p0 context.Context, p1 cid.Cid) (*ty func (s *IMarketStruct) NetAddrsListen(p0 context.Context) (peer.AddrInfo, error) { return s.Internal.NetAddrsListen(p0) } -func (s *IMarketStruct) OfflineDealImport(p0 context.Context, p1 market.MinerDeal) error { - return s.Internal.OfflineDealImport(p0, p1) -} func (s *IMarketStruct) PaychVoucherList(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) { return s.Internal.PaychVoucherList(p0, p1) }