From 8d672aceb36499d16b34a25b0e63341f418ef4c9 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Fri, 8 Mar 2024 18:33:22 -0600 Subject: [PATCH] udpate mock files and fix test issues --- e2e/tests/storage_test.go | 66 +------------ .../keeper/grpc_query_params_by_timestamp.go | 2 +- x/payment/types/expected_keepers_mocks.go | 14 --- x/storage/keeper/grpc_query.go | 2 +- x/storage/keeper/grpc_query_test.go | 4 +- x/storage/keeper/keeper_object_test.go | 3 + x/storage/keeper/payment_test.go | 5 +- x/storage/types/expected_keepers_mocks.go | 97 ++++++++++--------- .../types/expected_keepers_mocks.go | 72 +++++++------- 9 files changed, 101 insertions(+), 164 deletions(-) diff --git a/e2e/tests/storage_test.go b/e2e/tests/storage_test.go index a5fdb5695..9c715e7f3 100644 --- a/e2e/tests/storage_test.go +++ b/e2e/tests/storage_test.go @@ -829,56 +829,11 @@ func (s *StorageTestSuite) TestDiscontinueObject_UserDeleted() { // DiscontinueObject msgDiscontinueObject := storagetypes.NewMsgDiscontinueObject(sp.GcKey.GetAddr(), bucketName, []sdkmath.Uint{objectId}, "test") - txRes := s.SendTxBlock(sp.GcKey, msgDiscontinueObject) - deleteAt := filterDiscontinueObjectEventFromTx(txRes).DeleteAt + _ = s.SendTxBlock(sp.GcKey, msgDiscontinueObject) // DeleteObject before discontinue confirm window msgDeleteObject := storagetypes.NewMsgDeleteObject(user.GetAddr(), bucketName, objectName) - txRes = s.SendTxBlock(user, msgDeleteObject) - event := filterDeleteObjectEventFromTx(txRes) - s.Require().Equal(event.ObjectId, objectId) - - // Wait after the delete timestamp - heightBefore := txRes.Height - heightAfter := int64(0) - for { - time.Sleep(200 * time.Millisecond) - statusRes, err := s.TmClient.TmClient.Status(context.Background()) - s.Require().NoError(err) - blockTime := statusRes.SyncInfo.LatestBlockTime.Unix() - - s.T().Logf("current blockTime: %d, delete blockTime: %d", blockTime, deleteAt) - - if blockTime >= deleteAt { - heightAfter = statusRes.SyncInfo.LatestBlockHeight - break - } else { - heightBefore = statusRes.SyncInfo.LatestBlockHeight - } - } - - time.Sleep(200 * time.Millisecond) - events := make([]storagetypes.EventDeleteObject, 0) - for heightBefore <= heightAfter { - blockRes, err := s.TmClient.TmClient.BlockResults(context.Background(), &heightBefore) - s.Require().NoError(err) - events = append(events, filterDeleteObjectEventFromBlock(blockRes)...) - heightBefore++ - } - - // Already deleted by user - found := false - for _, event := range events { - if event.ObjectId.Equal(objectId) { - found = true - } - } - s.Require().True(!found) - - time.Sleep(500 * time.Millisecond) - statusRes, err := s.TmClient.TmClient.Status(context.Background()) - s.Require().NoError(err) - s.Require().True(statusRes.SyncInfo.LatestBlockHeight > heightAfter) + s.SendTxBlockWithExpectErrorString(msgDeleteObject, user, "is discontined") } func (s *StorageTestSuite) TestDiscontinueBucket_Normal() { @@ -1191,23 +1146,6 @@ func filterDeleteObjectEventFromBlock(blockRes *ctypes.ResultBlockResults) []sto return events } -func filterDeleteObjectEventFromTx(txRes *sdk.TxResponse) storagetypes.EventDeleteObject { - objectIdStr := "" - for _, event := range txRes.Events { - if event.Type == "greenfield.storage.EventDeleteObject" { - for _, attr := range event.Attributes { - if string(attr.Key) == "object_id" { - objectIdStr = strings.Trim(string(attr.Value), `"`) - } - } - } - } - objectId := sdkmath.NewUintFromString(objectIdStr) - return storagetypes.EventDeleteObject{ - ObjectId: objectId, - } -} - func filterDiscontinueBucketEventFromTx(txRes *sdk.TxResponse) storagetypes.EventDiscontinueBucket { deleteAtStr := "" for _, event := range txRes.Logs[0].Events { diff --git a/x/payment/keeper/grpc_query_params_by_timestamp.go b/x/payment/keeper/grpc_query_params_by_timestamp.go index 80a156fd0..9ead0f0ce 100644 --- a/x/payment/keeper/grpc_query_params_by_timestamp.go +++ b/x/payment/keeper/grpc_query_params_by_timestamp.go @@ -18,7 +18,7 @@ func (k Keeper) ParamsByTimestamp(c context.Context, req *types.QueryParamsByTim ts := req.GetTimestamp() if ts == 0 { - ts = ctx.BlockTime().Unix() + ts = ctx.BlockTime().Unix() + 1 } params := k.GetParams(ctx) diff --git a/x/payment/types/expected_keepers_mocks.go b/x/payment/types/expected_keepers_mocks.go index 35cb18582..9450c3ce7 100644 --- a/x/payment/types/expected_keepers_mocks.go +++ b/x/payment/types/expected_keepers_mocks.go @@ -182,20 +182,6 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderMo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } -// SendCoinsFromModuleToModule mocks base method. -func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx types.Context, senderModule string, recipientModule string, amt types.Coins) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderModule, recipientModule, amt) - ret0, _ := ret[0].(error) - return ret0 -} - -// SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) -} - // SpendableCoins mocks base method. func (m *MockBankKeeper) SpendableCoins(ctx types.Context, addr types.AccAddress) types.Coins { m.ctrl.T.Helper() diff --git a/x/storage/keeper/grpc_query.go b/x/storage/keeper/grpc_query.go index ea7e7911c..5426f0d09 100644 --- a/x/storage/keeper/grpc_query.go +++ b/x/storage/keeper/grpc_query.go @@ -40,7 +40,7 @@ func (k Keeper) QueryParamsByTimestamp(c context.Context, req *types.QueryParams ts := req.GetTimestamp() if ts == 0 { - ts = ctx.BlockTime().Unix() + ts = ctx.BlockTime().Unix() + 1 } params := k.GetParams(ctx) diff --git a/x/storage/keeper/grpc_query_test.go b/x/storage/keeper/grpc_query_test.go index 6744a2539..5a77fde2b 100644 --- a/x/storage/keeper/grpc_query_test.go +++ b/x/storage/keeper/grpc_query_test.go @@ -67,13 +67,13 @@ func (s *TestSuite) TestQueryVersionedParams() { err = s.storageKeeper.SetParams(s.ctx, params) s.Require().NoError(err) - responseT1, err := s.storageKeeper.QueryParamsByTimestamp(s.ctx, &types.QueryParamsByTimestampRequest{Timestamp: blockTimeT1}) + responseT1, err := s.storageKeeper.QueryParamsByTimestamp(s.ctx, &types.QueryParamsByTimestampRequest{Timestamp: blockTimeT1 + 1}) s.Require().NoError(err) s.Require().Equal(&types.QueryParamsByTimestampResponse{Params: paramsT1}, responseT1) getParams := responseT1.GetParams() s.Require().Equal(getParams.GetMaxSegmentSize(), uint64(1)) - responseT2, err := s.storageKeeper.QueryParamsByTimestamp(s.ctx, &types.QueryParamsByTimestampRequest{Timestamp: blockTimeT2}) + responseT2, err := s.storageKeeper.QueryParamsByTimestamp(s.ctx, &types.QueryParamsByTimestampRequest{Timestamp: blockTimeT2 + 1}) s.Require().NoError(err) s.Require().Equal(&types.QueryParamsByTimestampResponse{Params: paramsT2}, responseT2) p := responseT2.GetParams() diff --git a/x/storage/keeper/keeper_object_test.go b/x/storage/keeper/keeper_object_test.go index 013711ef7..ca7ae0a6e 100644 --- a/x/storage/keeper/keeper_object_test.go +++ b/x/storage/keeper/keeper_object_test.go @@ -1,6 +1,8 @@ package keeper_test import ( + "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/golang/mock/gomock" @@ -202,6 +204,7 @@ func (s *TestSuite) TestCreateObject() { OutFlowCount: 0, FrozenNetflowRate: math.Int{}, }, nil).AnyTimes() + s.ctx = s.ctx.WithBlockTime(s.ctx.BlockTime().Add(1 * time.Second)) _, err = s.storageKeeper.CreateObject(s.ctx, operatorAddress, bucketInfo.BucketName, objectName, 100, types.CreateObjectOptions{ Visibility: 0, diff --git a/x/storage/keeper/payment_test.go b/x/storage/keeper/payment_test.go index 3599114d1..04c5aae62 100644 --- a/x/storage/keeper/payment_test.go +++ b/x/storage/keeper/payment_test.go @@ -116,10 +116,11 @@ func (s *TestSuite) TestGetObjectLockFee() { Return(params.VersionedParams, nil).AnyTimes() // verify lock fee calculation + timeNow := time.Now().Unix() + 1 payloadSize := int64(10 * 1024 * 1024) - amount, err := s.storageKeeper.GetObjectLockFee(s.ctx, time.Now().Unix(), uint64(payloadSize)) + amount, err := s.storageKeeper.GetObjectLockFee(s.ctx, timeNow, uint64(payloadSize)) s.Require().NoError(err) - secondarySPNum := int64(s.storageKeeper.GetExpectSecondarySPNumForECObject(s.ctx, time.Now().Unix())) + secondarySPNum := int64(s.storageKeeper.GetExpectSecondarySPNumForECObject(s.ctx, timeNow)) spRate := price.PrimaryStorePrice.Add(price.SecondaryStorePrice.MulInt64(secondarySPNum)).MulInt64(payloadSize) validatorTaxRate := params.VersionedParams.ValidatorTaxRate.MulInt(spRate.TruncateInt()) expectedAmount := spRate.Add(validatorTaxRate).MulInt64(int64(params.VersionedParams.ReserveTime)).TruncateInt() diff --git a/x/storage/types/expected_keepers_mocks.go b/x/storage/types/expected_keepers_mocks.go index 76cc6084a..ff4f05972 100644 --- a/x/storage/types/expected_keepers_mocks.go +++ b/x/storage/types/expected_keepers_mocks.go @@ -834,6 +834,21 @@ func (mr *MockVirtualGroupKeeperMockRecorder) GetGlobalVirtualGroupIfAvailable(c return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGlobalVirtualGroupIfAvailable", reflect.TypeOf((*MockVirtualGroupKeeper)(nil).GetGlobalVirtualGroupIfAvailable), ctx, gvgID, expectedStoreSize) } +// GetSwapInInfo mocks base method. +func (m *MockVirtualGroupKeeper) GetSwapInInfo(ctx types3.Context, familyID, gvgID uint32) (*types2.SwapInInfo, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSwapInInfo", ctx, familyID, gvgID) + ret0, _ := ret[0].(*types2.SwapInInfo) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetSwapInInfo indicates an expected call of GetSwapInInfo. +func (mr *MockVirtualGroupKeeperMockRecorder) GetSwapInInfo(ctx, familyID, gvgID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSwapInInfo", reflect.TypeOf((*MockVirtualGroupKeeper)(nil).GetSwapInInfo), ctx, familyID, gvgID) +} + // SetGVGAndEmitUpdateEvent mocks base method. func (m *MockVirtualGroupKeeper) SetGVGAndEmitUpdateEvent(ctx types3.Context, gvg *types2.GlobalVirtualGroup) error { m.ctrl.T.Helper() @@ -876,51 +891,12 @@ func (mr *MockVirtualGroupKeeperMockRecorder) SettleAndDistributeGVGFamily(ctx, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SettleAndDistributeGVGFamily", reflect.TypeOf((*MockVirtualGroupKeeper)(nil).SettleAndDistributeGVGFamily), ctx, sp, family) } -// GetSwapInInfo mocks base method. -func (m *MockVirtualGroupKeeper) GetSwapInInfo(ctx types3.Context, familyID, gvgID uint32) (*types2.SwapInInfo, bool) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSwapInInfo", ctx, familyID, gvgID) - ret0, _ := ret[0].(*types2.SwapInInfo) - ret1, _ := ret[1].(bool) - return ret0, ret1 -} - -// GetSwapInInfo indicates an expected call of GetSwapInInfo. -func (mr *MockVirtualGroupKeeperMockRecorder) GetSwapInInfo(ctx, familyID, gvgID interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSwapInInfo", reflect.TypeOf((*MockVirtualGroupKeeper)(nil).GetSwapInInfo), ctx, familyID, gvgID) -} - // MockStorageKeeper is a mock of StorageKeeper interface. type MockStorageKeeper struct { ctrl *gomock.Controller recorder *MockStorageKeeperMockRecorder } -func (m *MockStorageKeeper) NormalizePrincipal(ctx types3.Context, principal *types0.Principal) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "NormalizePrincipal", ctx, principal) -} - -// NormalizePrincipal indicates an expected call of NormalizePrincipal. -func (mr *MockStorageKeeperMockRecorder) NormalizePrincipal(ctx types3.Context, principal *types0.Principal) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NormalizePrincipal", reflect.TypeOf((*MockStorageKeeper)(nil).NormalizePrincipal), ctx, principal) -} - -func (m *MockStorageKeeper) ValidatePrincipal(ctx types3.Context, resOwner types3.AccAddress, principal *types0.Principal) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ValidatePrincipal", ctx, resOwner, principal) - ret0, _ := ret[0].(error) - return ret0 -} - -// NormalizePrincipal indicates an expected call of NormalizePrincipal. -func (mr *MockStorageKeeperMockRecorder) ValidatePrincipal(ctx types3.Context, resOwner types3.AccAddress, principal *types0.Principal) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePrincipal", reflect.TypeOf((*MockStorageKeeper)(nil).ValidatePrincipal), ctx, resOwner, principal) -} - // MockStorageKeeperMockRecorder is the mock recorder for MockStorageKeeper. type MockStorageKeeperMockRecorder struct { mock *MockStorageKeeper @@ -1025,18 +1001,25 @@ func (mr *MockStorageKeeperMockRecorder) GetBucketInfoById(ctx, bucketId interfa return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBucketInfoById", reflect.TypeOf((*MockStorageKeeper)(nil).GetBucketInfoById), ctx, bucketId) } -// GetGroupInfoById mocks base method. -func (m *MockStorageKeeper) GetGroupInfoById(ctx types3.Context, groupId math.Uint) (*GroupInfo, bool) { +// GetGroupInfo mocks base method. +func (m *MockStorageKeeper) GetGroupInfo(ctx types3.Context, ownerAddr types3.AccAddress, groupName string) (*GroupInfo, bool) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetGroupInfoById", ctx, groupId) + ret := m.ctrl.Call(m, "GetGroupInfo", ctx, ownerAddr, groupName) ret0, _ := ret[0].(*GroupInfo) ret1, _ := ret[1].(bool) return ret0, ret1 } -func (m *MockStorageKeeper) GetGroupInfo(ctx types3.Context, ownerAddr types3.AccAddress, groupName string) (*GroupInfo, bool) { +// GetGroupInfo indicates an expected call of GetGroupInfo. +func (mr *MockStorageKeeperMockRecorder) GetGroupInfo(ctx, ownerAddr, groupName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGroupInfo", reflect.TypeOf((*MockStorageKeeper)(nil).GetGroupInfo), ctx, ownerAddr, groupName) +} + +// GetGroupInfoById mocks base method. +func (m *MockStorageKeeper) GetGroupInfoById(ctx types3.Context, groupId math.Uint) (*GroupInfo, bool) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetGroupInfo", ctx, ownerAddr, groupName) + ret := m.ctrl.Call(m, "GetGroupInfoById", ctx, groupId) ret0, _ := ret[0].(*GroupInfo) ret1, _ := ret[1].(bool) return ret0, ret1 @@ -1092,6 +1075,18 @@ func (mr *MockStorageKeeperMockRecorder) Logger(ctx interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Logger", reflect.TypeOf((*MockStorageKeeper)(nil).Logger), ctx) } +// NormalizePrincipal mocks base method. +func (m *MockStorageKeeper) NormalizePrincipal(ctx types3.Context, principal *types0.Principal) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "NormalizePrincipal", ctx, principal) +} + +// NormalizePrincipal indicates an expected call of NormalizePrincipal. +func (mr *MockStorageKeeperMockRecorder) NormalizePrincipal(ctx, principal interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NormalizePrincipal", reflect.TypeOf((*MockStorageKeeper)(nil).NormalizePrincipal), ctx, principal) +} + // RenewGroupMember mocks base method. func (m *MockStorageKeeper) RenewGroupMember(ctx types3.Context, operator types3.AccAddress, groupInfo *GroupInfo, opts RenewGroupMemberOptions) error { m.ctrl.T.Helper() @@ -1155,3 +1150,17 @@ func (mr *MockStorageKeeperMockRecorder) UpdateGroupMember(ctx, operator, groupI mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateGroupMember", reflect.TypeOf((*MockStorageKeeper)(nil).UpdateGroupMember), ctx, operator, groupInfo, opts) } + +// ValidatePrincipal mocks base method. +func (m *MockStorageKeeper) ValidatePrincipal(ctx types3.Context, resOwner types3.AccAddress, principal *types0.Principal) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatePrincipal", ctx, resOwner, principal) + ret0, _ := ret[0].(error) + return ret0 +} + +// ValidatePrincipal indicates an expected call of ValidatePrincipal. +func (mr *MockStorageKeeperMockRecorder) ValidatePrincipal(ctx, resOwner, principal interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePrincipal", reflect.TypeOf((*MockStorageKeeper)(nil).ValidatePrincipal), ctx, resOwner, principal) +} diff --git a/x/virtualgroup/types/expected_keepers_mocks.go b/x/virtualgroup/types/expected_keepers_mocks.go index 06f27e5e2..0282c45b7 100644 --- a/x/virtualgroup/types/expected_keepers_mocks.go +++ b/x/virtualgroup/types/expected_keepers_mocks.go @@ -46,7 +46,7 @@ func (m *MockSpKeeper) DepositDenomForSP(ctx types0.Context) string { } // DepositDenomForSP indicates an expected call of DepositDenomForSP. -func (mr *MockSpKeeperMockRecorder) DepositDenomForSP(ctx any) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) DepositDenomForSP(ctx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DepositDenomForSP", reflect.TypeOf((*MockSpKeeper)(nil).DepositDenomForSP), ctx) } @@ -60,11 +60,25 @@ func (m *MockSpKeeper) Exit(ctx types0.Context, sp *types.StorageProvider) error } // Exit indicates an expected call of Exit. -func (mr *MockSpKeeperMockRecorder) Exit(ctx, sp any) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) Exit(ctx, sp interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exit", reflect.TypeOf((*MockSpKeeper)(nil).Exit), ctx, sp) } +// GetAllStorageProviders mocks base method. +func (m *MockSpKeeper) GetAllStorageProviders(ctx types0.Context) []types.StorageProvider { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllStorageProviders", ctx) + ret0, _ := ret[0].([]types.StorageProvider) + return ret0 +} + +// GetAllStorageProviders indicates an expected call of GetAllStorageProviders. +func (mr *MockSpKeeperMockRecorder) GetAllStorageProviders(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllStorageProviders", reflect.TypeOf((*MockSpKeeper)(nil).GetAllStorageProviders), ctx) +} + // GetStorageProvider mocks base method. func (m *MockSpKeeper) GetStorageProvider(ctx types0.Context, id uint32) (*types.StorageProvider, bool) { m.ctrl.T.Helper() @@ -75,7 +89,7 @@ func (m *MockSpKeeper) GetStorageProvider(ctx types0.Context, id uint32) (*types } // GetStorageProvider indicates an expected call of GetStorageProvider. -func (mr *MockSpKeeperMockRecorder) GetStorageProvider(ctx, id any) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) GetStorageProvider(ctx, id interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageProvider", reflect.TypeOf((*MockSpKeeper)(nil).GetStorageProvider), ctx, id) } @@ -90,7 +104,7 @@ func (m *MockSpKeeper) GetStorageProviderByFundingAddr(ctx types0.Context, sealA } // GetStorageProviderByFundingAddr indicates an expected call of GetStorageProviderByFundingAddr. -func (mr *MockSpKeeperMockRecorder) GetStorageProviderByFundingAddr(ctx, sealAddr any) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) GetStorageProviderByFundingAddr(ctx, sealAddr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageProviderByFundingAddr", reflect.TypeOf((*MockSpKeeper)(nil).GetStorageProviderByFundingAddr), ctx, sealAddr) } @@ -105,7 +119,7 @@ func (m *MockSpKeeper) GetStorageProviderByOperatorAddr(ctx types0.Context, addr } // GetStorageProviderByOperatorAddr indicates an expected call of GetStorageProviderByOperatorAddr. -func (mr *MockSpKeeperMockRecorder) GetStorageProviderByOperatorAddr(ctx, addr any) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) GetStorageProviderByOperatorAddr(ctx, addr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageProviderByOperatorAddr", reflect.TypeOf((*MockSpKeeper)(nil).GetStorageProviderByOperatorAddr), ctx, addr) } @@ -117,25 +131,11 @@ func (m *MockSpKeeper) SetStorageProvider(ctx types0.Context, sp *types.StorageP } // SetStorageProvider indicates an expected call of SetStorageProvider. -func (mr *MockSpKeeperMockRecorder) SetStorageProvider(ctx, sp any) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) SetStorageProvider(ctx, sp interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStorageProvider", reflect.TypeOf((*MockSpKeeper)(nil).SetStorageProvider), ctx, sp) } -// GetAllStorageProviders mocks base method. -func (m *MockSpKeeper) GetAllStorageProviders(ctx types0.Context) (sps []types.StorageProvider) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAllStorageProviders", ctx) - ret0, _ := ret[0].([]types.StorageProvider) - return ret0 -} - -// GetAllStorageProviders indicates an expected call of GetAllStorageProviders. -func (mr *MockSpKeeperMockRecorder) GetAllStorageProviders(ctx any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllStorageProviders", reflect.TypeOf((*MockSpKeeper)(nil).GetAllStorageProviders), ctx) -} - // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller @@ -168,7 +168,7 @@ func (m *MockAccountKeeper) GetAccount(ctx types0.Context, addr types0.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -182,7 +182,7 @@ func (m *MockAccountKeeper) GetModuleAccount(ctx types0.Context, moduleName stri } // GetModuleAccount indicates an expected call of GetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName any) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) } @@ -196,7 +196,7 @@ func (m *MockAccountKeeper) GetModuleAddress(name string) types0.AccAddress { } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name any) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), name) } @@ -208,7 +208,7 @@ func (m *MockAccountKeeper) IterateAccounts(ctx types0.Context, process func(typ } // IterateAccounts indicates an expected call of IterateAccounts. -func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process any) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process) } @@ -220,7 +220,7 @@ func (m *MockAccountKeeper) SetModuleAccount(arg0 types0.Context, arg1 types1.Mo } // SetModuleAccount indicates an expected call of SetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 any) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), arg0, arg1) } @@ -257,7 +257,7 @@ func (m *MockBankKeeper) GetAllBalances(ctx types0.Context, addr types0.AccAddre } // GetAllBalances indicates an expected call of GetAllBalances. -func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) } @@ -271,7 +271,7 @@ func (m *MockBankKeeper) GetBalance(ctx types0.Context, addr types0.AccAddress, } // GetBalance indicates an expected call of GetBalance. -func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom any) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockBankKeeper)(nil).GetBalance), ctx, addr, denom) } @@ -285,7 +285,7 @@ func (m *MockBankKeeper) LockedCoins(ctx types0.Context, addr types0.AccAddress) } // LockedCoins indicates an expected call of LockedCoins. -func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr any) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockedCoins", reflect.TypeOf((*MockBankKeeper)(nil).LockedCoins), ctx, addr) } @@ -299,7 +299,7 @@ func (m *MockBankKeeper) SendCoins(ctx types0.Context, fromAddr, toAddr types0.A } // SendCoins indicates an expected call of SendCoins. -func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt any) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) } @@ -313,7 +313,7 @@ func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx types0.Context, sender } // SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } @@ -327,7 +327,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx types0.Context, sender } // SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -341,7 +341,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx types0.Context, addr types0.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } @@ -378,7 +378,7 @@ func (m *MockPaymentKeeper) IsEmptyNetFlow(ctx types0.Context, account types0.Ac } // IsEmptyNetFlow indicates an expected call of IsEmptyNetFlow. -func (mr *MockPaymentKeeperMockRecorder) IsEmptyNetFlow(ctx, account any) *gomock.Call { +func (mr *MockPaymentKeeperMockRecorder) IsEmptyNetFlow(ctx, account interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsEmptyNetFlow", reflect.TypeOf((*MockPaymentKeeper)(nil).IsEmptyNetFlow), ctx, account) } @@ -393,7 +393,7 @@ func (m *MockPaymentKeeper) QueryDynamicBalance(ctx types0.Context, addr types0. } // QueryDynamicBalance indicates an expected call of QueryDynamicBalance. -func (mr *MockPaymentKeeperMockRecorder) QueryDynamicBalance(ctx, addr any) *gomock.Call { +func (mr *MockPaymentKeeperMockRecorder) QueryDynamicBalance(ctx, addr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryDynamicBalance", reflect.TypeOf((*MockPaymentKeeper)(nil).QueryDynamicBalance), ctx, addr) } @@ -407,7 +407,7 @@ func (m *MockPaymentKeeper) Withdraw(ctx types0.Context, fromAddr, toAddr types0 } // Withdraw indicates an expected call of Withdraw. -func (mr *MockPaymentKeeperMockRecorder) Withdraw(ctx, fromAddr, toAddr, amount any) *gomock.Call { +func (mr *MockPaymentKeeperMockRecorder) Withdraw(ctx, fromAddr, toAddr, amount interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Withdraw", reflect.TypeOf((*MockPaymentKeeper)(nil).Withdraw), ctx, fromAddr, toAddr, amount) } @@ -444,7 +444,7 @@ func (m *MockStorageKeeper) GetExpectSecondarySPNumForECObject(ctx types0.Contex } // GetExpectSecondarySPNumForECObject indicates an expected call of GetExpectSecondarySPNumForECObject. -func (mr *MockStorageKeeperMockRecorder) GetExpectSecondarySPNumForECObject(ctx, time any) *gomock.Call { +func (mr *MockStorageKeeperMockRecorder) GetExpectSecondarySPNumForECObject(ctx, time interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExpectSecondarySPNumForECObject", reflect.TypeOf((*MockStorageKeeper)(nil).GetExpectSecondarySPNumForECObject), ctx, time) }