From 9bdbbf96881b67f0b3b219d1c5492dd82d60a0b4 Mon Sep 17 00:00:00 2001 From: simlecode <69969590+simlecode@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:10:29 +0800 Subject: [PATCH] opt: DealsImportData adds parameter skipCommP --- venus-shared/api/market/v0/api.go | 4 ++-- venus-shared/api/market/v0/method.md | 3 ++- venus-shared/api/market/v0/mock/mock_imarket.go | 8 ++++---- venus-shared/api/market/v0/proxy_gen.go | 6 +++--- venus-shared/api/market/v1/api.go | 4 ++-- venus-shared/api/market/v1/method.md | 3 ++- venus-shared/api/market/v1/mock/mock_imarket.go | 8 ++++---- venus-shared/api/market/v1/proxy_gen.go | 6 +++--- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/venus-shared/api/market/v0/api.go b/venus-shared/api/market/v0/api.go index 7aedc68ce6..875ea6ca81 100644 --- a/venus-shared/api/market/v0/api.go +++ b/venus-shared/api/market/v0/api.go @@ -56,8 +56,8 @@ type IMarket interface { PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) //perm:read PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) //perm:read - DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error //perm:admin - OfflineDealImport(ctx context.Context, deal market.MinerDeal) error //perm:admin + DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string, skipCommP bool) error //perm:admin + OfflineDealImport(ctx context.Context, deal 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 1172d40b6a..a414847762 100644 --- a/venus-shared/api/market/v0/method.md +++ b/venus-shared/api/market/v0/method.md @@ -535,7 +535,8 @@ Inputs: { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "string value" + "string value", + true ] ``` diff --git a/venus-shared/api/market/v0/mock/mock_imarket.go b/venus-shared/api/market/v0/mock/mock_imarket.go index 708379d0f7..c46b72e8a8 100644 --- a/venus-shared/api/market/v0/mock/mock_imarket.go +++ b/venus-shared/api/market/v0/mock/mock_imarket.go @@ -358,17 +358,17 @@ func (mr *MockIMarketMockRecorder) DealsConsiderVerifiedStorageDeals(arg0, arg1 } // DealsImportData mocks base method. -func (m *MockIMarket) DealsImportData(arg0 context.Context, arg1 cid.Cid, arg2 string) error { +func (m *MockIMarket) DealsImportData(arg0 context.Context, arg1 cid.Cid, arg2 string, arg3 bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DealsImportData", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "DealsImportData", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(error) return ret0 } // DealsImportData indicates an expected call of DealsImportData. -func (mr *MockIMarketMockRecorder) DealsImportData(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockIMarketMockRecorder) DealsImportData(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsImportData", reflect.TypeOf((*MockIMarket)(nil).DealsImportData), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsImportData", reflect.TypeOf((*MockIMarket)(nil).DealsImportData), arg0, arg1, arg2, arg3) } // DealsMaxProviderCollateralMultiplier mocks base method. diff --git a/venus-shared/api/market/v0/proxy_gen.go b/venus-shared/api/market/v0/proxy_gen.go index bc1b7cd4ec..dd66c9644f 100644 --- a/venus-shared/api/market/v0/proxy_gen.go +++ b/venus-shared/api/market/v0/proxy_gen.go @@ -43,7 +43,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"` - DealsImportData func(ctx context.Context, dealPropCid cid.Cid, file string) 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"` DealsMaxStartDelay func(context.Context, address.Address) (time.Duration, error) `perm:"read"` @@ -183,8 +183,8 @@ 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) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error { - return s.Internal.DealsImportData(p0, p1, p2) +func (s *IMarketStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string, p3 bool) error { + return s.Internal.DealsImportData(p0, p1, p2, p3) } func (s *IMarketStruct) DealsMaxProviderCollateralMultiplier(p0 context.Context, p1 address.Address) (uint64, error) { return s.Internal.DealsMaxProviderCollateralMultiplier(p0, p1) diff --git a/venus-shared/api/market/v1/api.go b/venus-shared/api/market/v1/api.go index 6db6f03139..29502f70f6 100644 --- a/venus-shared/api/market/v1/api.go +++ b/venus-shared/api/market/v1/api.go @@ -56,8 +56,8 @@ type IMarket interface { PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) //perm:read PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) //perm:read - DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error //perm:admin - OfflineDealImport(ctx context.Context, deal market.MinerDeal) error //perm:admin + DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string, skipCommP bool) error //perm:admin + OfflineDealImport(ctx context.Context, deal 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 085e12ee4b..ef48550188 100644 --- a/venus-shared/api/market/v1/method.md +++ b/venus-shared/api/market/v1/method.md @@ -536,7 +536,8 @@ Inputs: { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, - "string value" + "string value", + true ] ``` diff --git a/venus-shared/api/market/v1/mock/mock_imarket.go b/venus-shared/api/market/v1/mock/mock_imarket.go index b964a6ca3e..7d4b2cdbe1 100644 --- a/venus-shared/api/market/v1/mock/mock_imarket.go +++ b/venus-shared/api/market/v1/mock/mock_imarket.go @@ -358,17 +358,17 @@ func (mr *MockIMarketMockRecorder) DealsConsiderVerifiedStorageDeals(arg0, arg1 } // DealsImportData mocks base method. -func (m *MockIMarket) DealsImportData(arg0 context.Context, arg1 cid.Cid, arg2 string) error { +func (m *MockIMarket) DealsImportData(arg0 context.Context, arg1 cid.Cid, arg2 string, arg3 bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DealsImportData", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "DealsImportData", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(error) return ret0 } // DealsImportData indicates an expected call of DealsImportData. -func (mr *MockIMarketMockRecorder) DealsImportData(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockIMarketMockRecorder) DealsImportData(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsImportData", reflect.TypeOf((*MockIMarket)(nil).DealsImportData), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsImportData", reflect.TypeOf((*MockIMarket)(nil).DealsImportData), arg0, arg1, arg2, arg3) } // DealsMaxProviderCollateralMultiplier mocks base method. diff --git a/venus-shared/api/market/v1/proxy_gen.go b/venus-shared/api/market/v1/proxy_gen.go index 258062982a..2b29feb064 100644 --- a/venus-shared/api/market/v1/proxy_gen.go +++ b/venus-shared/api/market/v1/proxy_gen.go @@ -43,7 +43,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"` - DealsImportData func(ctx context.Context, dealPropCid cid.Cid, file string) 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"` DealsMaxStartDelay func(context.Context, address.Address) (time.Duration, error) `perm:"read"` @@ -184,8 +184,8 @@ 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) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error { - return s.Internal.DealsImportData(p0, p1, p2) +func (s *IMarketStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string, p3 bool) error { + return s.Internal.DealsImportData(p0, p1, p2, p3) } func (s *IMarketStruct) DealsMaxProviderCollateralMultiplier(p0 context.Context, p1 address.Address) (uint64, error) { return s.Internal.DealsMaxProviderCollateralMultiplier(p0, p1)