diff --git a/Makefile b/Makefile index e69107543..9ca570d74 100644 --- a/Makefile +++ b/Makefile @@ -338,21 +338,21 @@ lint-fix: mock: ##@other Regenerate mocks mockgen -package=fake -destination=transactions/fake/mock.go -source=transactions/fake/txservice.go - mockgen -package=status -destination=services/status/account_mock.go -source=services/status/service.go mockgen -package=peer -destination=services/peer/discoverer_mock.go -source=services/peer/service.go - mockgen -package=mock_transactor -destination=transactions/mock_transactor/transactor.go -source=transactions/transactor.go - mockgen -package=mock_pathprocessor -destination=services/wallet/router/pathprocessor/mock_pathprocessor/processor.go -source=services/wallet/router/pathprocessor/processor.go - mockgen -package=mock_bridge -destination=services/wallet/bridge/mock_bridge/bridge.go -source=services/wallet/bridge/bridge.go - mockgen -package=mock_client -destination=rpc/chain/mock/client/client.go -source=rpc/chain/client.go - mockgen -package=mock_token -destination=services/wallet/token/mock/token/tokenmanager.go -source=services/wallet/token/token.go - mockgen -package=mock_thirdparty -destination=services/wallet/thirdparty/mock/types.go -source=services/wallet/thirdparty/types.go - mockgen -package=mock_balance_persistence -destination=services/wallet/token/mock/balance_persistence/balance_persistence.go -source=services/wallet/token/balance_persistence.go - mockgen -package=mock_network -destination=rpc/network/mock/network.go -source=rpc/network/network.go - mockgen -package=mock_rpcclient -destination=rpc/mock/client/client.go -source=rpc/client.go - mockgen -package=mock_collectibles -destination=services/wallet/collectibles/mock/collection_data_db.go -source=services/wallet/collectibles/collection_data_db.go - mockgen -package=mock_collectibles -destination=services/wallet/collectibles/mock/collectible_data_db.go -source=services/wallet/collectibles/collectible_data_db.go - mockgen -package=mock_thirdparty -destination=services/wallet/thirdparty/mock/collectible_types.go -source=services/wallet/thirdparty/collectible_types.go - mockgen -package=mock_paraswap -destination=services/wallet/thirdparty/paraswap/mock/types.go -source=services/wallet/thirdparty/paraswap/types.go + mockgen -package=mock_contracts -destination=contracts/mock/contracts.go -source=contracts/contracts.go + mockgen -package=mocksettings -destination=multiaccounts/settings/mocks/database_settings_manager_mock.go -source=multiaccounts/settings/database_settings_manager.go + mockgen -package=mock_transactor -destination=transactions/mock_transactor/transactor.go -source=transactions/transactor.go + mockgen -package=mock_rpcclient -destination=rpc/mock/client/client.go -source=rpc/client.go + mockgen -package=mock_network -destination=rpc/network/mock/network.go -source=rpc/network/network.go + mockgen -package=mock_client -destination=rpc/chain/mock/client/client.go -source=rpc/chain/client.go + mockgen -package=mock_token -destination=services/wallet/token/mock/token/tokenmanager.go -source=services/wallet/token/token.go + mockgen -package=mock_balance_persistence -destination=services/wallet/token/mock/balance_persistence/balance_persistence.go -source=services/wallet/token/balance_persistence.go + mockgen -package=mock_collectibles -destination=services/wallet/collectibles/mock/collectible_data_db.go -source=services/wallet/collectibles/collectible_data_db.go + mockgen -package=mock_collectibles -destination=services/wallet/collectibles/mock/collection_data_db.go -source=services/wallet/collectibles/collection_data_db.go + mockgen -package=mock_thirdparty -destination=services/wallet/thirdparty/mock/types.go -source=services/wallet/thirdparty/types.go + mockgen -package=mock_thirdparty -destination=services/wallet/thirdparty/mock/collectible_types.go -source=services/wallet/thirdparty/collectible_types.go + mockgen -package=mock_paraswap -destination=services/wallet/thirdparty/paraswap/mock/types.go -source=services/wallet/thirdparty/paraswap/types.go + mockgen -package=mock_pathprocessor -destination=services/wallet/router/pathprocessor/mock_pathprocessor/processor.go -source=services/wallet/router/pathprocessor/processor.go mockgen -package=mock_onramp -destination=services/wallet/onramp/mock/types.go -source=services/wallet/onramp/types.go docker-test: ##@tests Run tests in a docker container with golang. diff --git a/contracts/mock/contracts.go b/contracts/mock/contracts.go index bb7b7cf82..0bc640a24 100644 --- a/contracts/mock/contracts.go +++ b/contracts/mock/contracts.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: contracts/contracts.go +// +// Generated by this command: +// +// mockgen -package=mock_contracts -destination=contracts/mock/contracts.go -source=contracts/contracts.go +// // Package mock_contracts is a generated GoMock package. package mock_contracts @@ -7,11 +12,10 @@ package mock_contracts import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" - common "github.com/ethereum/go-ethereum/common" ethscan "github.com/status-im/status-go/contracts/ethscan" ierc20 "github.com/status-im/status-go/contracts/ierc20" + gomock "go.uber.org/mock/gomock" ) // MockContractMakerIface is a mock of ContractMakerIface interface. @@ -47,7 +51,7 @@ func (m *MockContractMakerIface) NewERC20(chainID uint64, contractAddr common.Ad } // NewERC20 indicates an expected call of NewERC20. -func (mr *MockContractMakerIfaceMockRecorder) NewERC20(chainID, contractAddr interface{}) *gomock.Call { +func (mr *MockContractMakerIfaceMockRecorder) NewERC20(chainID, contractAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewERC20", reflect.TypeOf((*MockContractMakerIface)(nil).NewERC20), chainID, contractAddr) } @@ -62,7 +66,7 @@ func (m *MockContractMakerIface) NewERC20Caller(chainID uint64, contractAddr com } // NewERC20Caller indicates an expected call of NewERC20Caller. -func (mr *MockContractMakerIfaceMockRecorder) NewERC20Caller(chainID, contractAddr interface{}) *gomock.Call { +func (mr *MockContractMakerIfaceMockRecorder) NewERC20Caller(chainID, contractAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewERC20Caller", reflect.TypeOf((*MockContractMakerIface)(nil).NewERC20Caller), chainID, contractAddr) } @@ -78,7 +82,7 @@ func (m *MockContractMakerIface) NewEthScan(chainID uint64) (ethscan.BalanceScan } // NewEthScan indicates an expected call of NewEthScan. -func (mr *MockContractMakerIfaceMockRecorder) NewEthScan(chainID interface{}) *gomock.Call { +func (mr *MockContractMakerIfaceMockRecorder) NewEthScan(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewEthScan", reflect.TypeOf((*MockContractMakerIface)(nil).NewEthScan), chainID) } diff --git a/go.mod b/go.mod index c5a4a5e90..19aad07eb 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,6 @@ require ( github.com/deckarep/golang-set v1.8.0 github.com/ethereum/go-ethereum v1.10.26 github.com/forPelevin/gomoji v1.1.2 - github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 github.com/google/uuid v1.4.0 github.com/hashicorp/go-version v1.2.0 diff --git a/go.sum b/go.sum index 31adf513a..a73269fe8 100644 --- a/go.sum +++ b/go.sum @@ -953,7 +953,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/multiaccounts/settings/mocks/database_data_modification_settings.go b/multiaccounts/settings/mocks/database_data_modification_settings.go deleted file mode 100644 index d021daf9e..000000000 --- a/multiaccounts/settings/mocks/database_data_modification_settings.go +++ /dev/null @@ -1,282 +0,0 @@ -package mocksettings - -import ( - reflect "reflect" - - gomock "github.com/golang/mock/gomock" - - settings "github.com/status-im/status-go/multiaccounts/settings" - params "github.com/status-im/status-go/params" -) - -// CreateSettings mocks base method. -func (m *MockDatabaseSettingsManager) CreateSettings(s settings.Settings, n params.NodeConfig) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateSettings", s, n) - ret0, _ := ret[0].(error) - return ret0 -} - -// CreateSettings indicates an expected call of CreateSettings. -func (mr *MockDatabaseSettingsManagerMockRecorder) CreateSettings(s, n interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSettings", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).CreateSettings), s, n) -} - -// SaveSetting mocks base method. -func (m *MockDatabaseSettingsManager) SaveSetting(setting string, value interface{}) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SaveSetting", setting, value) - ret0, _ := ret[0].(error) - return ret0 -} - -// SaveSetting indicates an expected call of SaveSetting. -func (mr *MockDatabaseSettingsManagerMockRecorder) SaveSetting(setting, value interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveSetting", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SaveSetting), setting, value) -} - -// SaveSettingField mocks base method. -func (m *MockDatabaseSettingsManager) SaveSettingField(sf settings.SettingField, value interface{}) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SaveSettingField", sf, value) - ret0, _ := ret[0].(error) - return ret0 -} - -// SaveSettingField indicates an expected call of SaveSettingField. -func (mr *MockDatabaseSettingsManagerMockRecorder) SaveSettingField(sf, value interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveSettingField", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SaveSettingField), sf, value) -} - -// DeleteMnemonic mocks base method. -func (m *MockDatabaseSettingsManager) DeleteMnemonic() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteMnemonic") - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteMnemonic indicates an expected call of DeleteMnemonic. -func (mr *MockDatabaseSettingsManagerMockRecorder) DeleteMnemonic() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMnemonic", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).DeleteMnemonic)) -} - -// SaveSyncSetting mocks base method. -func (m *MockDatabaseSettingsManager) SaveSyncSetting(setting settings.SettingField, value interface{}, clock uint64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SaveSyncSetting", setting, value, clock) - ret0, _ := ret[0].(error) - return ret0 -} - -// SaveSyncSetting indicates an expected call of SaveSyncSetting. -func (mr *MockDatabaseSettingsManagerMockRecorder) SaveSyncSetting(setting, value, clock interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveSyncSetting", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SaveSyncSetting), setting, value, clock) -} - -// SetSettingLastSynced mocks base method. -func (m *MockDatabaseSettingsManager) SetSettingLastSynced(setting settings.SettingField, clock uint64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetSettingLastSynced", setting, clock) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetSettingLastSynced indicates an expected call of SetSettingLastSynced. -func (mr *MockDatabaseSettingsManagerMockRecorder) SetSettingLastSynced(setting, clock interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSettingLastSynced", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetSettingLastSynced), setting, clock) -} - -// SetSettingsNotifier mocks base method. -func (m *MockDatabaseSettingsManager) SetSettingsNotifier(n settings.Notifier) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "SetSettingsNotifier", n) -} - -// SetSettingsNotifier indicates an expected call of SetSettingsNotifier. -func (mr *MockDatabaseSettingsManagerMockRecorder) SetSettingsNotifier(n interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSettingsNotifier", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetSettingsNotifier), n) -} - -// SetLastBackup mocks base method. -func (m *MockDatabaseSettingsManager) SetLastBackup(time uint64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetLastBackup", time) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetLastBackup indicates an expected call of SetLastBackup. -func (mr *MockDatabaseSettingsManagerMockRecorder) SetLastBackup(time interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLastBackup", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetLastBackup), time) -} - -// SetBackupFetched mocks base method. -func (m *MockDatabaseSettingsManager) SetBackupFetched(fetched bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetBackupFetched", fetched) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetBackupFetched indicates an expected call of SetBackupFetched. -func (mr *MockDatabaseSettingsManagerMockRecorder) SetBackupFetched(fetched interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBackupFetched", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetBackupFetched), fetched) -} - -// SetPinnedMailservers mocks base method. -func (m *MockDatabaseSettingsManager) SetPinnedMailservers(mailservers map[string]string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetPinnedMailservers", mailservers) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetPinnedMailservers indicates an expected call of SetPinnedMailservers. -func (mr *MockDatabaseSettingsManagerMockRecorder) SetPinnedMailservers(mailservers interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPinnedMailservers", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetPinnedMailservers), mailservers) -} - -// SetTokenGroupByCommunity mocks base method. -func (m *MockDatabaseSettingsManager) SetTokenGroupByCommunity(value bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetTokenGroupByCommunity", value) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetTokenGroupByCommunity indicates an expected call of SetTokenGroupByCommunity. -func (mr *MockDatabaseSettingsManagerMockRecorder) SetTokenGroupByCommunity(value interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTokenGroupByCommunity", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetTokenGroupByCommunity), value) -} - -// GetTelemetryServerURL mocks base method. -func (m *MockDatabaseSettingsManager) GetTelemetryServerURL() (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTelemetryServerURL") - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetTelemetryServerURL indicates an expected call of GetTelemetryServerURL. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetTelemetryServerURL() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTelemetryServerURL", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetTelemetryServerURL)) -} - -// GetTestNetworksEnabled mocks base method. -func (m *MockDatabaseSettingsManager) GetTestNetworksEnabled() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTestNetworksEnabled") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetTestNetworksEnabled indicates an expected call of GetTestNetworksEnabled. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetTestNetworksEnabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTestNetworksEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetTestNetworksEnabled)) -} - -// GetTokenGroupByCommunity mocks base method. -func (m *MockDatabaseSettingsManager) GetTokenGroupByCommunity() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTokenGroupByCommunity") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetTokenGroupByCommunity indicates an expected call of GetTokenGroupByCommunity. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetTokenGroupByCommunity() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenGroupByCommunity", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetTokenGroupByCommunity)) -} - -// GetDisplayAssetsBelowBalance mocks base method. -func (m *MockDatabaseSettingsManager) GetDisplayAssetsBelowBalance() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDisplayAssetsBelowBalance") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetDisplayAssetsBelowBalance indicates an expected call of GetDisplayAssetsBelowBalance. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetDisplayAssetsBelowBalance() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDisplayAssetsBelowBalance", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetDisplayAssetsBelowBalance)) -} - -// GetDisplayAssetsBelowBalanceThreshold mocks base method. -func (m *MockDatabaseSettingsManager) GetDisplayAssetsBelowBalanceThreshold() (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDisplayAssetsBelowBalanceThreshold") - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetDisplayAssetsBelowBalanceThreshold indicates an expected call of GetDisplayAssetsBelowBalanceThreshold. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetDisplayAssetsBelowBalanceThreshold() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDisplayAssetsBelowBalanceThreshold", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetDisplayAssetsBelowBalanceThreshold)) -} - -// GetCollectibleGroupByCommunity mocks base method. -func (m *MockDatabaseSettingsManager) GetCollectibleGroupByCommunity() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCollectibleGroupByCommunity") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetCollectibleGroupByCommunity indicates an expected call of GetCollectibleGroupByCommunity. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetCollectibleGroupByCommunity() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCollectibleGroupByCommunity", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetCollectibleGroupByCommunity)) -} - -// GetCollectibleGroupByCollection mocks base method. -func (m *MockDatabaseSettingsManager) GetCollectibleGroupByCollection() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCollectibleGroupByCollection") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetCollectibleGroupByCollection indicates an expected call of GetCollectibleGroupByCollection. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetCollectibleGroupByCollection() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCollectibleGroupByCollection", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetCollectibleGroupByCollection)) -} - -// URLUnfurlingMode mocks base method. -func (m *MockDatabaseSettingsManager) URLUnfurlingMode() (int64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "URLUnfurlingMode") - ret0, _ := ret[0].(int64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// URLUnfurlingMode indicates an expected call of URLUnfurlingMode. -func (mr *MockDatabaseSettingsManagerMockRecorder) URLUnfurlingMode() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "URLUnfurlingMode", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).URLUnfurlingMode)) -} diff --git a/multiaccounts/settings/mocks/database_data_retriever_mock.go b/multiaccounts/settings/mocks/database_data_retriever_mock.go deleted file mode 100644 index aaab4207c..000000000 --- a/multiaccounts/settings/mocks/database_data_retriever_mock.go +++ /dev/null @@ -1,250 +0,0 @@ -package mocksettings - -import ( - json "encoding/json" - reflect "reflect" - - gomock "github.com/golang/mock/gomock" - - types "github.com/status-im/status-go/eth-node/types" - settings "github.com/status-im/status-go/multiaccounts/settings" -) - -// GetSettingLastSynced mocks base method. -func (m *MockDatabaseSettingsManager) GetSettingLastSynced(setting settings.SettingField) (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSettingLastSynced", setting) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetSettingLastSynced indicates an expected call of GetSettingLastSynced. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetSettingLastSynced(setting interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSettingLastSynced", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetSettingLastSynced), setting) -} - -// GetNotificationsEnabled mocks base method. -func (m *MockDatabaseSettingsManager) GetNotificationsEnabled() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetNotificationsEnabled") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetNotificationsEnabled indicates an expected call of GetNotificationsEnabled. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetNotificationsEnabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNotificationsEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetNotificationsEnabled)) -} - -// GetProfilePicturesVisibility mocks base method. -func (m *MockDatabaseSettingsManager) GetProfilePicturesVisibility() (int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetProfilePicturesVisibility") - ret0, _ := ret[0].(int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetProfilePicturesVisibility indicates an expected call of GetProfilePicturesVisibility. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetProfilePicturesVisibility() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProfilePicturesVisibility", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetProfilePicturesVisibility)) -} - -// GetPublicKey mocks base method. -func (m *MockDatabaseSettingsManager) GetPublicKey() (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetPublicKey") - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetPublicKey indicates an expected call of GetPublicKey. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetPublicKey() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPublicKey", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetPublicKey)) -} - -// GetFleet mocks base method. -func (m *MockDatabaseSettingsManager) GetFleet() (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetFleet") - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetFleet indicates an expected call of GetFleet. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetFleet() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFleet", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetFleet)) -} - -// GetDappsAddress mocks base method. -func (m *MockDatabaseSettingsManager) GetDappsAddress() (types.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDappsAddress") - ret0, _ := ret[0].(types.Address) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetDappsAddress indicates an expected call of GetDappsAddress. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetDappsAddress() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDappsAddress", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetDappsAddress)) -} - -// GetPinnedMailservers mocks base method. -func (m *MockDatabaseSettingsManager) GetPinnedMailservers() (map[string]string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetPinnedMailservers") - ret0, _ := ret[0].(map[string]string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetPinnedMailservers indicates an expected call of GetPinnedMailservers. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetPinnedMailservers() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPinnedMailservers", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetPinnedMailservers)) -} - -// GetDefaultSyncPeriod mocks base method. -func (m *MockDatabaseSettingsManager) GetDefaultSyncPeriod() (uint32, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDefaultSyncPeriod") - ret0, _ := ret[0].(uint32) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetDefaultSyncPeriod indicates an expected call of GetDefaultSyncPeriod. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetDefaultSyncPeriod() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultSyncPeriod", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetDefaultSyncPeriod)) -} - -// GetMessagesFromContactsOnly mocks base method. -func (m *MockDatabaseSettingsManager) GetMessagesFromContactsOnly() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetMessagesFromContactsOnly") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetMessagesFromContactsOnly indicates an expected call of GetMessagesFromContactsOnly. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetMessagesFromContactsOnly() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMessagesFromContactsOnly", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetMessagesFromContactsOnly)) -} - -// GetProfilePicturesShowTo mocks base method. -func (m *MockDatabaseSettingsManager) GetProfilePicturesShowTo() (int64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetProfilePicturesShowTo") - ret0, _ := ret[0].(int64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetProfilePicturesShowTo indicates an expected call of GetProfilePicturesShowTo. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetProfilePicturesShowTo() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProfilePicturesShowTo", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetProfilePicturesShowTo)) -} - -// GetLatestDerivedPath mocks base method. -func (m *MockDatabaseSettingsManager) GetLatestDerivedPath() (uint, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetLatestDerivedPath") - ret0, _ := ret[0].(uint) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetLatestDerivedPath indicates an expected call of GetLatestDerivedPath. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetLatestDerivedPath() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatestDerivedPath", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetLatestDerivedPath)) -} - -// GetCurrentStatus mocks base method. -func (m *MockDatabaseSettingsManager) GetCurrentStatus(status interface{}) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCurrentStatus", status) - ret0, _ := ret[0].(error) - return ret0 -} - -// GetCurrentStatus indicates an expected call of GetCurrentStatus. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetCurrentStatus(status interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentStatus", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetCurrentStatus), status) -} - -// GetWalletRootAddress mocks base method. -func (m *MockDatabaseSettingsManager) GetWalletRootAddress() (types.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetWalletRootAddress") - ret0, _ := ret[0].(types.Address) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetWalletRootAddress indicates an expected call of GetWalletRootAddress. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetWalletRootAddress() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWalletRootAddress", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetWalletRootAddress)) -} - -// GifAPIKey mocks base method. -func (m *MockDatabaseSettingsManager) GifAPIKey() (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GifAPIKey") - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GifAPIKey indicates an expected call of GifAPIKey. -func (mr *MockDatabaseSettingsManagerMockRecorder) GifAPIKey() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GifAPIKey", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GifAPIKey)) -} - -// GifFavorites mocks base method. -func (m *MockDatabaseSettingsManager) GifFavorites() (json.RawMessage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GifFavorites") - ret0, _ := ret[0].(json.RawMessage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GifFavorites indicates an expected call of GifFavorites. -func (mr *MockDatabaseSettingsManagerMockRecorder) GifFavorites() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GifFavorites", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GifFavorites)) -} - -// GifRecents mocks base method. -func (m *MockDatabaseSettingsManager) GifRecents() (json.RawMessage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GifRecents") - ret0, _ := ret[0].(json.RawMessage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GifRecents indicates an expected call of GifRecents. -func (mr *MockDatabaseSettingsManagerMockRecorder) GifRecents() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GifRecents", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GifRecents)) -} diff --git a/multiaccounts/settings/mocks/database_info_retriever_mock.go b/multiaccounts/settings/mocks/database_info_retriever_mock.go deleted file mode 100644 index 4cb1c86d1..000000000 --- a/multiaccounts/settings/mocks/database_info_retriever_mock.go +++ /dev/null @@ -1,236 +0,0 @@ -// URLUnfurlingMode mocks base method. -package mocksettings - -import ( - sql "database/sql" - reflect "reflect" - - gomock "github.com/golang/mock/gomock" - - settings "github.com/status-im/status-go/multiaccounts/settings" -) - -// GetDB mocks base method. -func (m *MockDatabaseSettingsManager) GetDB() *sql.DB { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDB") - ret0, _ := ret[0].(*sql.DB) - return ret0 -} - -// GetDB indicates an expected call of GetDB. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetDB() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDB", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetDB)) -} - -// GetSyncQueue mocks base method. -func (m *MockDatabaseSettingsManager) GetSyncQueue() chan settings.SyncSettingField { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncQueue") - ret0, _ := ret[0].(chan settings.SyncSettingField) - return ret0 -} - -// GetSyncQueue indicates an expected call of GetSyncQueue. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetSyncQueue() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncQueue", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetSyncQueue)) -} - -// GetChangesSubscriptions mocks base method. -func (m *MockDatabaseSettingsManager) GetChangesSubscriptions() []chan *settings.SyncSettingField { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetChangesSubscriptions") - ret0, _ := ret[0].([]chan *settings.SyncSettingField) - return ret0 -} - -// GetChangesSubscriptions indicates an expected call of GetChangesSubscriptions. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetChangesSubscriptions() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChangesSubscriptions", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetChangesSubscriptions)) -} - -// GetNotifier mocks base method. -func (m *MockDatabaseSettingsManager) GetNotifier() settings.Notifier { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetNotifier") - ret0, _ := ret[0].(settings.Notifier) - return ret0 -} - -// GetNotifier indicates an expected call of GetNotifier. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetNotifier() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNotifier", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetNotifier)) -} - -// GetSettings mocks base method. -func (m *MockDatabaseSettingsManager) GetSettings() (settings.Settings, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSettings") - ret0, _ := ret[0].(settings.Settings) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetSettings indicates an expected call of GetSettings. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetSettings() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSettings", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetSettings)) -} - -// SubscribeToChanges mocks base method. -func (m *MockDatabaseSettingsManager) SubscribeToChanges() chan *settings.SyncSettingField { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SubscribeToChanges") - ret0, _ := ret[0].(chan *settings.SyncSettingField) - return ret0 -} - -// SubscribeToChanges indicates an expected call of SubscribeToChanges. -func (mr *MockDatabaseSettingsManagerMockRecorder) SubscribeToChanges() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeToChanges", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SubscribeToChanges)) -} - -// LastBackup mocks base method. -func (m *MockDatabaseSettingsManager) LastBackup() (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LastBackup") - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// LastBackup indicates an expected call of LastBackup. -func (mr *MockDatabaseSettingsManagerMockRecorder) LastBackup() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastBackup", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).LastBackup)) -} - -// Mnemonic mocks base method. -func (m *MockDatabaseSettingsManager) Mnemonic() (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Mnemonic") - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Mnemonic indicates an expected call of Mnemonic. -func (mr *MockDatabaseSettingsManagerMockRecorder) Mnemonic() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Mnemonic", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).Mnemonic)) -} - -// MnemonicRemoved mocks base method. -func (m *MockDatabaseSettingsManager) MnemonicRemoved() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MnemonicRemoved") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// MnemonicRemoved indicates an expected call of MnemonicRemoved. -func (mr *MockDatabaseSettingsManagerMockRecorder) MnemonicRemoved() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MnemonicRemoved", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).MnemonicRemoved)) -} - -// MnemonicWasShown mocks base method. -func (m *MockDatabaseSettingsManager) MnemonicWasShown() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MnemonicWasShown") - ret0, _ := ret[0].(error) - return ret0 -} - -// MnemonicWasShown indicates an expected call of MnemonicWasShown. -func (mr *MockDatabaseSettingsManagerMockRecorder) MnemonicWasShown() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MnemonicWasShown", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).MnemonicWasShown)) -} - -// MutualContactEnabled mocks base method. -func (m *MockDatabaseSettingsManager) MutualContactEnabled() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MutualContactEnabled") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// MutualContactEnabled indicates an expected call of MutualContactEnabled. -func (mr *MockDatabaseSettingsManagerMockRecorder) MutualContactEnabled() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MutualContactEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).MutualContactEnabled)) -} - -// ProfileMigrationNeeded mocks base method. -func (m *MockDatabaseSettingsManager) ProfileMigrationNeeded() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ProfileMigrationNeeded") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ProfileMigrationNeeded indicates an expected call of ProfileMigrationNeeded. -func (mr *MockDatabaseSettingsManagerMockRecorder) ProfileMigrationNeeded() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProfileMigrationNeeded", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).ProfileMigrationNeeded)) -} - -// SetUseMailservers mocks base method. -func (m *MockDatabaseSettingsManager) SetUseMailservers(value bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetUseMailservers", value) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetUseMailservers indicates an expected call of SetUseMailservers. -func (mr *MockDatabaseSettingsManagerMockRecorder) SetUseMailservers(value interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUseMailservers", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetUseMailservers), value) -} - -// SetPeerSyncingEnabled mocks base method. -func (m *MockDatabaseSettingsManager) SetPeerSyncingEnabled(value bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetPeerSyncingEnabled", value) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetSyncingOnMobileNetwork mocks base method. -func (m *MockDatabaseSettingsManager) SetSyncingOnMobileNetwork(value bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetSyncingOnMobile", value) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetPeerSyncingEnabled indicates an expected call of SetPeerSyncingEnabled. -func (mr *MockDatabaseSettingsManagerMockRecorder) SetPeerSyncingEnabled(value interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPeerSyncingEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetPeerSyncingEnabled), value) -} - -// ShouldBroadcastUserStatus mocks base method. -func (m *MockDatabaseSettingsManager) ShouldBroadcastUserStatus() (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ShouldBroadcastUserStatus") - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ShouldBroadcastUserStatus indicates an expected call of ShouldBroadcastUserStatus. -func (mr *MockDatabaseSettingsManagerMockRecorder) ShouldBroadcastUserStatus() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShouldBroadcastUserStatus", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).ShouldBroadcastUserStatus)) -} diff --git a/multiaccounts/settings/mocks/database_settings_manager_mock.go b/multiaccounts/settings/mocks/database_settings_manager_mock.go index e9e94fdd1..600e99b63 100644 --- a/multiaccounts/settings/mocks/database_settings_manager_mock.go +++ b/multiaccounts/settings/mocks/database_settings_manager_mock.go @@ -1,16 +1,23 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: database_settings_manager.go +// Source: multiaccounts/settings/database_settings_manager.go +// +// Generated by this command: +// +// mockgen -package=mocksettings -destination=multiaccounts/settings/mocks/database_settings_manager_mock.go -source=multiaccounts/settings/database_settings_manager.go +// -// Package mock_settings is a generated GoMock package. +// Package mocksettings is a generated GoMock package. package mocksettings import ( + sql "database/sql" json "encoding/json" reflect "reflect" - gomock "github.com/golang/mock/gomock" - types "github.com/status-im/status-go/eth-node/types" + settings "github.com/status-im/status-go/multiaccounts/settings" + params "github.com/status-im/status-go/params" + gomock "go.uber.org/mock/gomock" ) // MockDatabaseSettingsManager is a mock of DatabaseSettingsManager interface. @@ -126,6 +133,34 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) CanUseMailservers() *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanUseMailservers", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).CanUseMailservers)) } +// CreateSettings mocks base method. +func (m *MockDatabaseSettingsManager) CreateSettings(s settings.Settings, n params.NodeConfig) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateSettings", s, n) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateSettings indicates an expected call of CreateSettings. +func (mr *MockDatabaseSettingsManagerMockRecorder) CreateSettings(s, n any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSettings", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).CreateSettings), s, n) +} + +// DeleteMnemonic mocks base method. +func (m *MockDatabaseSettingsManager) DeleteMnemonic() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteMnemonic") + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteMnemonic indicates an expected call of DeleteMnemonic. +func (mr *MockDatabaseSettingsManagerMockRecorder) DeleteMnemonic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMnemonic", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).DeleteMnemonic)) +} + // DeviceName mocks base method. func (m *MockDatabaseSettingsManager) DeviceName() (string, error) { m.ctrl.T.Helper() @@ -171,6 +206,50 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) ENSName() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ENSName", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).ENSName)) } +// GetChangesSubscriptions mocks base method. +func (m *MockDatabaseSettingsManager) GetChangesSubscriptions() []chan *settings.SyncSettingField { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetChangesSubscriptions") + ret0, _ := ret[0].([]chan *settings.SyncSettingField) + return ret0 +} + +// GetChangesSubscriptions indicates an expected call of GetChangesSubscriptions. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetChangesSubscriptions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChangesSubscriptions", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetChangesSubscriptions)) +} + +// GetCollectibleGroupByCollection mocks base method. +func (m *MockDatabaseSettingsManager) GetCollectibleGroupByCollection() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCollectibleGroupByCollection") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCollectibleGroupByCollection indicates an expected call of GetCollectibleGroupByCollection. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetCollectibleGroupByCollection() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCollectibleGroupByCollection", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetCollectibleGroupByCollection)) +} + +// GetCollectibleGroupByCommunity mocks base method. +func (m *MockDatabaseSettingsManager) GetCollectibleGroupByCommunity() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCollectibleGroupByCommunity") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCollectibleGroupByCommunity indicates an expected call of GetCollectibleGroupByCommunity. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetCollectibleGroupByCommunity() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCollectibleGroupByCommunity", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetCollectibleGroupByCommunity)) +} + // GetCurrency mocks base method. func (m *MockDatabaseSettingsManager) GetCurrency() (string, error) { m.ctrl.T.Helper() @@ -186,6 +265,64 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) GetCurrency() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrency", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetCurrency)) } +// GetCurrentStatus mocks base method. +func (m *MockDatabaseSettingsManager) GetCurrentStatus(status any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCurrentStatus", status) + ret0, _ := ret[0].(error) + return ret0 +} + +// GetCurrentStatus indicates an expected call of GetCurrentStatus. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetCurrentStatus(status any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentStatus", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetCurrentStatus), status) +} + +// GetDB mocks base method. +func (m *MockDatabaseSettingsManager) GetDB() *sql.DB { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDB") + ret0, _ := ret[0].(*sql.DB) + return ret0 +} + +// GetDB indicates an expected call of GetDB. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetDB() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDB", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetDB)) +} + +// GetDappsAddress mocks base method. +func (m *MockDatabaseSettingsManager) GetDappsAddress() (types.Address, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDappsAddress") + ret0, _ := ret[0].(types.Address) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDappsAddress indicates an expected call of GetDappsAddress. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetDappsAddress() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDappsAddress", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetDappsAddress)) +} + +// GetDefaultSyncPeriod mocks base method. +func (m *MockDatabaseSettingsManager) GetDefaultSyncPeriod() (uint32, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDefaultSyncPeriod") + ret0, _ := ret[0].(uint32) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDefaultSyncPeriod indicates an expected call of GetDefaultSyncPeriod. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetDefaultSyncPeriod() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultSyncPeriod", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetDefaultSyncPeriod)) +} + // GetEIP1581Address mocks base method. func (m *MockDatabaseSettingsManager) GetEIP1581Address() (types.Address, error) { m.ctrl.T.Helper() @@ -201,6 +338,21 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) GetEIP1581Address() *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEIP1581Address", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetEIP1581Address)) } +// GetFleet mocks base method. +func (m *MockDatabaseSettingsManager) GetFleet() (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFleet") + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetFleet indicates an expected call of GetFleet. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetFleet() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFleet", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetFleet)) +} + // GetInstalledStickerPacks mocks base method. func (m *MockDatabaseSettingsManager) GetInstalledStickerPacks() (*json.RawMessage, error) { m.ctrl.T.Helper() @@ -231,6 +383,21 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) GetIsGoerliEnabled() *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIsGoerliEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetIsGoerliEnabled)) } +// GetLatestDerivedPath mocks base method. +func (m *MockDatabaseSettingsManager) GetLatestDerivedPath() (uint, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLatestDerivedPath") + ret0, _ := ret[0].(uint) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetLatestDerivedPath indicates an expected call of GetLatestDerivedPath. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetLatestDerivedPath() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatestDerivedPath", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetLatestDerivedPath)) +} + // GetMasterAddress mocks base method. func (m *MockDatabaseSettingsManager) GetMasterAddress() (types.Address, error) { m.ctrl.T.Helper() @@ -246,6 +413,21 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) GetMasterAddress() *gomock.Ca return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMasterAddress", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetMasterAddress)) } +// GetMessagesFromContactsOnly mocks base method. +func (m *MockDatabaseSettingsManager) GetMessagesFromContactsOnly() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMessagesFromContactsOnly") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetMessagesFromContactsOnly indicates an expected call of GetMessagesFromContactsOnly. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetMessagesFromContactsOnly() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMessagesFromContactsOnly", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetMessagesFromContactsOnly)) +} + // GetMnemonicWasNotShown mocks base method. func (m *MockDatabaseSettingsManager) GetMnemonicWasNotShown() (bool, error) { m.ctrl.T.Helper() @@ -261,6 +443,50 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) GetMnemonicWasNotShown() *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMnemonicWasNotShown", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetMnemonicWasNotShown)) } +// GetNotificationsEnabled mocks base method. +func (m *MockDatabaseSettingsManager) GetNotificationsEnabled() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetNotificationsEnabled") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetNotificationsEnabled indicates an expected call of GetNotificationsEnabled. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetNotificationsEnabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNotificationsEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetNotificationsEnabled)) +} + +// GetNotifier mocks base method. +func (m *MockDatabaseSettingsManager) GetNotifier() settings.Notifier { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetNotifier") + ret0, _ := ret[0].(settings.Notifier) + return ret0 +} + +// GetNotifier indicates an expected call of GetNotifier. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetNotifier() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNotifier", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetNotifier)) +} + +// GetPeerSyncingEnabled mocks base method. +func (m *MockDatabaseSettingsManager) GetPeerSyncingEnabled() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPeerSyncingEnabled") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPeerSyncingEnabled indicates an expected call of GetPeerSyncingEnabled. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetPeerSyncingEnabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeerSyncingEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetPeerSyncingEnabled)) +} + // GetPendingStickerPacks mocks base method. func (m *MockDatabaseSettingsManager) GetPendingStickerPacks() (*json.RawMessage, error) { m.ctrl.T.Helper() @@ -276,6 +502,21 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) GetPendingStickerPacks() *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPendingStickerPacks", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetPendingStickerPacks)) } +// GetPinnedMailservers mocks base method. +func (m *MockDatabaseSettingsManager) GetPinnedMailservers() (map[string]string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPinnedMailservers") + ret0, _ := ret[0].(map[string]string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPinnedMailservers indicates an expected call of GetPinnedMailservers. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetPinnedMailservers() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPinnedMailservers", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetPinnedMailservers)) +} + // GetPreferredUsername mocks base method. func (m *MockDatabaseSettingsManager) GetPreferredUsername() (string, error) { m.ctrl.T.Helper() @@ -291,6 +532,51 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) GetPreferredUsername() *gomoc return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPreferredUsername", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetPreferredUsername)) } +// GetProfilePicturesShowTo mocks base method. +func (m *MockDatabaseSettingsManager) GetProfilePicturesShowTo() (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetProfilePicturesShowTo") + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetProfilePicturesShowTo indicates an expected call of GetProfilePicturesShowTo. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetProfilePicturesShowTo() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProfilePicturesShowTo", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetProfilePicturesShowTo)) +} + +// GetProfilePicturesVisibility mocks base method. +func (m *MockDatabaseSettingsManager) GetProfilePicturesVisibility() (int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetProfilePicturesVisibility") + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetProfilePicturesVisibility indicates an expected call of GetProfilePicturesVisibility. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetProfilePicturesVisibility() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProfilePicturesVisibility", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetProfilePicturesVisibility)) +} + +// GetPublicKey mocks base method. +func (m *MockDatabaseSettingsManager) GetPublicKey() (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPublicKey") + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPublicKey indicates an expected call of GetPublicKey. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetPublicKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPublicKey", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetPublicKey)) +} + // GetRecentStickers mocks base method. func (m *MockDatabaseSettingsManager) GetRecentStickers() (*json.RawMessage, error) { m.ctrl.T.Helper() @@ -306,17 +592,450 @@ func (mr *MockDatabaseSettingsManagerMockRecorder) GetRecentStickers() *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecentStickers", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetRecentStickers)) } -// GetPeerSyncingEnabled mocks base method. -func (m *MockDatabaseSettingsManager) GetPeerSyncingEnabled() (bool, error) { +// GetSettingLastSynced mocks base method. +func (m *MockDatabaseSettingsManager) GetSettingLastSynced(setting settings.SettingField) (uint64, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetPeerSyncingEnabled") + ret := m.ctrl.Call(m, "GetSettingLastSynced", setting) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSettingLastSynced indicates an expected call of GetSettingLastSynced. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetSettingLastSynced(setting any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSettingLastSynced", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetSettingLastSynced), setting) +} + +// GetSettings mocks base method. +func (m *MockDatabaseSettingsManager) GetSettings() (settings.Settings, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSettings") + ret0, _ := ret[0].(settings.Settings) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSettings indicates an expected call of GetSettings. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetSettings() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSettings", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetSettings)) +} + +// GetSyncQueue mocks base method. +func (m *MockDatabaseSettingsManager) GetSyncQueue() chan settings.SyncSettingField { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSyncQueue") + ret0, _ := ret[0].(chan settings.SyncSettingField) + return ret0 +} + +// GetSyncQueue indicates an expected call of GetSyncQueue. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetSyncQueue() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncQueue", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetSyncQueue)) +} + +// GetTelemetryServerURL mocks base method. +func (m *MockDatabaseSettingsManager) GetTelemetryServerURL() (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTelemetryServerURL") + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTelemetryServerURL indicates an expected call of GetTelemetryServerURL. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetTelemetryServerURL() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTelemetryServerURL", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetTelemetryServerURL)) +} + +// GetTestNetworksEnabled mocks base method. +func (m *MockDatabaseSettingsManager) GetTestNetworksEnabled() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTestNetworksEnabled") ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetPeerSyncingEnabled indicates an expected call of GetPeerSyncingEnabled. -func (mr *MockDatabaseSettingsManagerMockRecorder) GetPeerSyncingEnabled() *gomock.Call { +// GetTestNetworksEnabled indicates an expected call of GetTestNetworksEnabled. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetTestNetworksEnabled() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeerSyncingEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetPeerSyncingEnabled)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTestNetworksEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetTestNetworksEnabled)) +} + +// GetTokenGroupByCommunity mocks base method. +func (m *MockDatabaseSettingsManager) GetTokenGroupByCommunity() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokenGroupByCommunity") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTokenGroupByCommunity indicates an expected call of GetTokenGroupByCommunity. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetTokenGroupByCommunity() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenGroupByCommunity", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetTokenGroupByCommunity)) +} + +// GetWalletRootAddress mocks base method. +func (m *MockDatabaseSettingsManager) GetWalletRootAddress() (types.Address, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetWalletRootAddress") + ret0, _ := ret[0].(types.Address) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetWalletRootAddress indicates an expected call of GetWalletRootAddress. +func (mr *MockDatabaseSettingsManagerMockRecorder) GetWalletRootAddress() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWalletRootAddress", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GetWalletRootAddress)) +} + +// GifAPIKey mocks base method. +func (m *MockDatabaseSettingsManager) GifAPIKey() (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GifAPIKey") + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GifAPIKey indicates an expected call of GifAPIKey. +func (mr *MockDatabaseSettingsManagerMockRecorder) GifAPIKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GifAPIKey", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GifAPIKey)) +} + +// GifFavorites mocks base method. +func (m *MockDatabaseSettingsManager) GifFavorites() (json.RawMessage, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GifFavorites") + ret0, _ := ret[0].(json.RawMessage) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GifFavorites indicates an expected call of GifFavorites. +func (mr *MockDatabaseSettingsManagerMockRecorder) GifFavorites() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GifFavorites", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GifFavorites)) +} + +// GifRecents mocks base method. +func (m *MockDatabaseSettingsManager) GifRecents() (json.RawMessage, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GifRecents") + ret0, _ := ret[0].(json.RawMessage) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GifRecents indicates an expected call of GifRecents. +func (mr *MockDatabaseSettingsManagerMockRecorder) GifRecents() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GifRecents", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).GifRecents)) +} + +// LastBackup mocks base method. +func (m *MockDatabaseSettingsManager) LastBackup() (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LastBackup") + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LastBackup indicates an expected call of LastBackup. +func (mr *MockDatabaseSettingsManagerMockRecorder) LastBackup() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastBackup", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).LastBackup)) +} + +// Mnemonic mocks base method. +func (m *MockDatabaseSettingsManager) Mnemonic() (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Mnemonic") + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Mnemonic indicates an expected call of Mnemonic. +func (mr *MockDatabaseSettingsManagerMockRecorder) Mnemonic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Mnemonic", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).Mnemonic)) +} + +// MnemonicRemoved mocks base method. +func (m *MockDatabaseSettingsManager) MnemonicRemoved() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MnemonicRemoved") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MnemonicRemoved indicates an expected call of MnemonicRemoved. +func (mr *MockDatabaseSettingsManagerMockRecorder) MnemonicRemoved() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MnemonicRemoved", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).MnemonicRemoved)) +} + +// MnemonicWasShown mocks base method. +func (m *MockDatabaseSettingsManager) MnemonicWasShown() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MnemonicWasShown") + ret0, _ := ret[0].(error) + return ret0 +} + +// MnemonicWasShown indicates an expected call of MnemonicWasShown. +func (mr *MockDatabaseSettingsManagerMockRecorder) MnemonicWasShown() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MnemonicWasShown", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).MnemonicWasShown)) +} + +// MutualContactEnabled mocks base method. +func (m *MockDatabaseSettingsManager) MutualContactEnabled() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MutualContactEnabled") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MutualContactEnabled indicates an expected call of MutualContactEnabled. +func (mr *MockDatabaseSettingsManagerMockRecorder) MutualContactEnabled() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MutualContactEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).MutualContactEnabled)) +} + +// ProfileMigrationNeeded mocks base method. +func (m *MockDatabaseSettingsManager) ProfileMigrationNeeded() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ProfileMigrationNeeded") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ProfileMigrationNeeded indicates an expected call of ProfileMigrationNeeded. +func (mr *MockDatabaseSettingsManagerMockRecorder) ProfileMigrationNeeded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProfileMigrationNeeded", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).ProfileMigrationNeeded)) +} + +// SaveSetting mocks base method. +func (m *MockDatabaseSettingsManager) SaveSetting(setting string, value any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SaveSetting", setting, value) + ret0, _ := ret[0].(error) + return ret0 +} + +// SaveSetting indicates an expected call of SaveSetting. +func (mr *MockDatabaseSettingsManagerMockRecorder) SaveSetting(setting, value any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveSetting", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SaveSetting), setting, value) +} + +// SaveSettingField mocks base method. +func (m *MockDatabaseSettingsManager) SaveSettingField(sf settings.SettingField, value any) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SaveSettingField", sf, value) + ret0, _ := ret[0].(error) + return ret0 +} + +// SaveSettingField indicates an expected call of SaveSettingField. +func (mr *MockDatabaseSettingsManagerMockRecorder) SaveSettingField(sf, value any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveSettingField", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SaveSettingField), sf, value) +} + +// SaveSyncSetting mocks base method. +func (m *MockDatabaseSettingsManager) SaveSyncSetting(setting settings.SettingField, value any, clock uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SaveSyncSetting", setting, value, clock) + ret0, _ := ret[0].(error) + return ret0 +} + +// SaveSyncSetting indicates an expected call of SaveSyncSetting. +func (mr *MockDatabaseSettingsManagerMockRecorder) SaveSyncSetting(setting, value, clock any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveSyncSetting", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SaveSyncSetting), setting, value, clock) +} + +// SetBackupFetched mocks base method. +func (m *MockDatabaseSettingsManager) SetBackupFetched(fetched bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetBackupFetched", fetched) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetBackupFetched indicates an expected call of SetBackupFetched. +func (mr *MockDatabaseSettingsManagerMockRecorder) SetBackupFetched(fetched any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBackupFetched", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetBackupFetched), fetched) +} + +// SetLastBackup mocks base method. +func (m *MockDatabaseSettingsManager) SetLastBackup(time uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetLastBackup", time) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetLastBackup indicates an expected call of SetLastBackup. +func (mr *MockDatabaseSettingsManagerMockRecorder) SetLastBackup(time any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLastBackup", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetLastBackup), time) +} + +// SetPeerSyncingEnabled mocks base method. +func (m *MockDatabaseSettingsManager) SetPeerSyncingEnabled(value bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetPeerSyncingEnabled", value) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetPeerSyncingEnabled indicates an expected call of SetPeerSyncingEnabled. +func (mr *MockDatabaseSettingsManagerMockRecorder) SetPeerSyncingEnabled(value any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPeerSyncingEnabled", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetPeerSyncingEnabled), value) +} + +// SetPinnedMailservers mocks base method. +func (m *MockDatabaseSettingsManager) SetPinnedMailservers(mailservers map[string]string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetPinnedMailservers", mailservers) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetPinnedMailservers indicates an expected call of SetPinnedMailservers. +func (mr *MockDatabaseSettingsManagerMockRecorder) SetPinnedMailservers(mailservers any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPinnedMailservers", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetPinnedMailservers), mailservers) +} + +// SetSettingLastSynced mocks base method. +func (m *MockDatabaseSettingsManager) SetSettingLastSynced(setting settings.SettingField, clock uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetSettingLastSynced", setting, clock) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetSettingLastSynced indicates an expected call of SetSettingLastSynced. +func (mr *MockDatabaseSettingsManagerMockRecorder) SetSettingLastSynced(setting, clock any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSettingLastSynced", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetSettingLastSynced), setting, clock) +} + +// SetSettingsNotifier mocks base method. +func (m *MockDatabaseSettingsManager) SetSettingsNotifier(n settings.Notifier) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetSettingsNotifier", n) +} + +// SetSettingsNotifier indicates an expected call of SetSettingsNotifier. +func (mr *MockDatabaseSettingsManagerMockRecorder) SetSettingsNotifier(n any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSettingsNotifier", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetSettingsNotifier), n) +} + +// SetSyncingOnMobileNetwork mocks base method. +func (m *MockDatabaseSettingsManager) SetSyncingOnMobileNetwork(value bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetSyncingOnMobileNetwork", value) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetSyncingOnMobileNetwork indicates an expected call of SetSyncingOnMobileNetwork. +func (mr *MockDatabaseSettingsManagerMockRecorder) SetSyncingOnMobileNetwork(value any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSyncingOnMobileNetwork", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetSyncingOnMobileNetwork), value) +} + +// SetTokenGroupByCommunity mocks base method. +func (m *MockDatabaseSettingsManager) SetTokenGroupByCommunity(value bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetTokenGroupByCommunity", value) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetTokenGroupByCommunity indicates an expected call of SetTokenGroupByCommunity. +func (mr *MockDatabaseSettingsManagerMockRecorder) SetTokenGroupByCommunity(value any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTokenGroupByCommunity", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetTokenGroupByCommunity), value) +} + +// SetUseMailservers mocks base method. +func (m *MockDatabaseSettingsManager) SetUseMailservers(value bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetUseMailservers", value) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetUseMailservers indicates an expected call of SetUseMailservers. +func (mr *MockDatabaseSettingsManagerMockRecorder) SetUseMailservers(value any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUseMailservers", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SetUseMailservers), value) +} + +// ShouldBroadcastUserStatus mocks base method. +func (m *MockDatabaseSettingsManager) ShouldBroadcastUserStatus() (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ShouldBroadcastUserStatus") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ShouldBroadcastUserStatus indicates an expected call of ShouldBroadcastUserStatus. +func (mr *MockDatabaseSettingsManagerMockRecorder) ShouldBroadcastUserStatus() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShouldBroadcastUserStatus", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).ShouldBroadcastUserStatus)) +} + +// SubscribeToChanges mocks base method. +func (m *MockDatabaseSettingsManager) SubscribeToChanges() chan *settings.SyncSettingField { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SubscribeToChanges") + ret0, _ := ret[0].(chan *settings.SyncSettingField) + return ret0 +} + +// SubscribeToChanges indicates an expected call of SubscribeToChanges. +func (mr *MockDatabaseSettingsManagerMockRecorder) SubscribeToChanges() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeToChanges", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).SubscribeToChanges)) +} + +// URLUnfurlingMode mocks base method. +func (m *MockDatabaseSettingsManager) URLUnfurlingMode() (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "URLUnfurlingMode") + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// URLUnfurlingMode indicates an expected call of URLUnfurlingMode. +func (mr *MockDatabaseSettingsManagerMockRecorder) URLUnfurlingMode() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "URLUnfurlingMode", reflect.TypeOf((*MockDatabaseSettingsManager)(nil).URLUnfurlingMode)) } diff --git a/rpc/chain/mock/client/client.go b/rpc/chain/mock/client/client.go index 57ddeb5df..85022685b 100644 --- a/rpc/chain/mock/client/client.go +++ b/rpc/chain/mock/client/client.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: rpc/chain/client.go +// +// Generated by this command: +// +// mockgen -package=mock_client -destination=rpc/chain/mock/client/client.go -source=rpc/chain/client.go +// // Package mock_client is a generated GoMock package. package mock_client @@ -9,13 +14,13 @@ import ( big "math/big" reflect "reflect" - gomock "github.com/golang/mock/gomock" - ethereum "github.com/ethereum/go-ethereum" common "github.com/ethereum/go-ethereum/common" types "github.com/ethereum/go-ethereum/core/types" rpc "github.com/ethereum/go-ethereum/rpc" + circuitbreaker "github.com/status-im/status-go/circuitbreaker" chain "github.com/status-im/status-go/rpc/chain" + gomock "go.uber.org/mock/gomock" ) // MockBatchCallClient is a mock of BatchCallClient interface. @@ -50,7 +55,7 @@ func (m *MockBatchCallClient) BatchCallContext(ctx context.Context, b []rpc.Batc } // BatchCallContext indicates an expected call of BatchCallContext. -func (mr *MockBatchCallClientMockRecorder) BatchCallContext(ctx, b interface{}) *gomock.Call { +func (mr *MockBatchCallClientMockRecorder) BatchCallContext(ctx, b any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchCallContext", reflect.TypeOf((*MockBatchCallClient)(nil).BatchCallContext), ctx, b) } @@ -88,7 +93,7 @@ func (m *MockChainInterface) BalanceAt(ctx context.Context, account common.Addre } // BalanceAt indicates an expected call of BalanceAt. -func (mr *MockChainInterfaceMockRecorder) BalanceAt(ctx, account, blockNumber interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) BalanceAt(ctx, account, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BalanceAt", reflect.TypeOf((*MockChainInterface)(nil).BalanceAt), ctx, account, blockNumber) } @@ -102,7 +107,7 @@ func (m *MockChainInterface) BatchCallContext(ctx context.Context, b []rpc.Batch } // BatchCallContext indicates an expected call of BatchCallContext. -func (mr *MockChainInterfaceMockRecorder) BatchCallContext(ctx, b interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) BatchCallContext(ctx, b any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchCallContext", reflect.TypeOf((*MockChainInterface)(nil).BatchCallContext), ctx, b) } @@ -117,7 +122,7 @@ func (m *MockChainInterface) BlockByHash(ctx context.Context, hash common.Hash) } // BlockByHash indicates an expected call of BlockByHash. -func (mr *MockChainInterfaceMockRecorder) BlockByHash(ctx, hash interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) BlockByHash(ctx, hash any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockByHash", reflect.TypeOf((*MockChainInterface)(nil).BlockByHash), ctx, hash) } @@ -132,7 +137,7 @@ func (m *MockChainInterface) BlockByNumber(ctx context.Context, number *big.Int) } // BlockByNumber indicates an expected call of BlockByNumber. -func (mr *MockChainInterfaceMockRecorder) BlockByNumber(ctx, number interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) BlockByNumber(ctx, number any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockByNumber", reflect.TypeOf((*MockChainInterface)(nil).BlockByNumber), ctx, number) } @@ -147,7 +152,7 @@ func (m *MockChainInterface) BlockNumber(ctx context.Context) (uint64, error) { } // BlockNumber indicates an expected call of BlockNumber. -func (mr *MockChainInterfaceMockRecorder) BlockNumber(ctx interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) BlockNumber(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockNumber", reflect.TypeOf((*MockChainInterface)(nil).BlockNumber), ctx) } @@ -162,15 +167,15 @@ func (m *MockChainInterface) CallBlockHashByTransaction(ctx context.Context, blo } // CallBlockHashByTransaction indicates an expected call of CallBlockHashByTransaction. -func (mr *MockChainInterfaceMockRecorder) CallBlockHashByTransaction(ctx, blockNumber, index interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) CallBlockHashByTransaction(ctx, blockNumber, index any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallBlockHashByTransaction", reflect.TypeOf((*MockChainInterface)(nil).CallBlockHashByTransaction), ctx, blockNumber, index) } // CallContext mocks base method. -func (m *MockChainInterface) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { +func (m *MockChainInterface) CallContext(ctx context.Context, result any, method string, args ...any) error { m.ctrl.T.Helper() - varargs := []interface{}{ctx, result, method} + varargs := []any{ctx, result, method} for _, a := range args { varargs = append(varargs, a) } @@ -180,9 +185,9 @@ func (m *MockChainInterface) CallContext(ctx context.Context, result interface{} } // CallContext indicates an expected call of CallContext. -func (mr *MockChainInterfaceMockRecorder) CallContext(ctx, result, method interface{}, args ...interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) CallContext(ctx, result, method any, args ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, result, method}, args...) + varargs := append([]any{ctx, result, method}, args...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallContext", reflect.TypeOf((*MockChainInterface)(nil).CallContext), varargs...) } @@ -196,7 +201,7 @@ func (m *MockChainInterface) CallContract(ctx context.Context, call ethereum.Cal } // CallContract indicates an expected call of CallContract. -func (mr *MockChainInterfaceMockRecorder) CallContract(ctx, call, blockNumber interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) CallContract(ctx, call, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallContract", reflect.TypeOf((*MockChainInterface)(nil).CallContract), ctx, call, blockNumber) } @@ -211,7 +216,7 @@ func (m *MockChainInterface) CodeAt(ctx context.Context, contract common.Address } // CodeAt indicates an expected call of CodeAt. -func (mr *MockChainInterfaceMockRecorder) CodeAt(ctx, contract, blockNumber interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) CodeAt(ctx, contract, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CodeAt", reflect.TypeOf((*MockChainInterface)(nil).CodeAt), ctx, contract, blockNumber) } @@ -226,7 +231,7 @@ func (m *MockChainInterface) FilterLogs(ctx context.Context, q ethereum.FilterQu } // FilterLogs indicates an expected call of FilterLogs. -func (mr *MockChainInterfaceMockRecorder) FilterLogs(ctx, q interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) FilterLogs(ctx, q any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilterLogs", reflect.TypeOf((*MockChainInterface)(nil).FilterLogs), ctx, q) } @@ -241,7 +246,7 @@ func (m *MockChainInterface) GetBaseFeeFromBlock(ctx context.Context, blockNumbe } // GetBaseFeeFromBlock indicates an expected call of GetBaseFeeFromBlock. -func (mr *MockChainInterfaceMockRecorder) GetBaseFeeFromBlock(ctx, blockNumber interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) GetBaseFeeFromBlock(ctx, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBaseFeeFromBlock", reflect.TypeOf((*MockChainInterface)(nil).GetBaseFeeFromBlock), ctx, blockNumber) } @@ -256,7 +261,7 @@ func (m *MockChainInterface) HeaderByHash(ctx context.Context, hash common.Hash) } // HeaderByHash indicates an expected call of HeaderByHash. -func (mr *MockChainInterfaceMockRecorder) HeaderByHash(ctx, hash interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) HeaderByHash(ctx, hash any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeaderByHash", reflect.TypeOf((*MockChainInterface)(nil).HeaderByHash), ctx, hash) } @@ -271,7 +276,7 @@ func (m *MockChainInterface) HeaderByNumber(ctx context.Context, number *big.Int } // HeaderByNumber indicates an expected call of HeaderByNumber. -func (mr *MockChainInterfaceMockRecorder) HeaderByNumber(ctx, number interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) HeaderByNumber(ctx, number any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeaderByNumber", reflect.TypeOf((*MockChainInterface)(nil).HeaderByNumber), ctx, number) } @@ -300,7 +305,7 @@ func (m *MockChainInterface) NonceAt(ctx context.Context, account common.Address } // NonceAt indicates an expected call of NonceAt. -func (mr *MockChainInterfaceMockRecorder) NonceAt(ctx, account, blockNumber interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) NonceAt(ctx, account, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NonceAt", reflect.TypeOf((*MockChainInterface)(nil).NonceAt), ctx, account, blockNumber) } @@ -330,7 +335,7 @@ func (m *MockChainInterface) TransactionByHash(ctx context.Context, hash common. } // TransactionByHash indicates an expected call of TransactionByHash. -func (mr *MockChainInterfaceMockRecorder) TransactionByHash(ctx, hash interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) TransactionByHash(ctx, hash any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionByHash", reflect.TypeOf((*MockChainInterface)(nil).TransactionByHash), ctx, hash) } @@ -345,7 +350,7 @@ func (m *MockChainInterface) TransactionReceipt(ctx context.Context, txHash comm } // TransactionReceipt indicates an expected call of TransactionReceipt. -func (mr *MockChainInterfaceMockRecorder) TransactionReceipt(ctx, txHash interface{}) *gomock.Call { +func (mr *MockChainInterfaceMockRecorder) TransactionReceipt(ctx, txHash any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionReceipt", reflect.TypeOf((*MockChainInterface)(nil).TransactionReceipt), ctx, txHash) } @@ -383,7 +388,7 @@ func (m *MockClientInterface) BalanceAt(ctx context.Context, account common.Addr } // BalanceAt indicates an expected call of BalanceAt. -func (mr *MockClientInterfaceMockRecorder) BalanceAt(ctx, account, blockNumber interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) BalanceAt(ctx, account, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BalanceAt", reflect.TypeOf((*MockClientInterface)(nil).BalanceAt), ctx, account, blockNumber) } @@ -397,7 +402,7 @@ func (m *MockClientInterface) BatchCallContext(ctx context.Context, b []rpc.Batc } // BatchCallContext indicates an expected call of BatchCallContext. -func (mr *MockClientInterfaceMockRecorder) BatchCallContext(ctx, b interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) BatchCallContext(ctx, b any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BatchCallContext", reflect.TypeOf((*MockClientInterface)(nil).BatchCallContext), ctx, b) } @@ -412,7 +417,7 @@ func (m *MockClientInterface) BlockByHash(ctx context.Context, hash common.Hash) } // BlockByHash indicates an expected call of BlockByHash. -func (mr *MockClientInterfaceMockRecorder) BlockByHash(ctx, hash interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) BlockByHash(ctx, hash any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockByHash", reflect.TypeOf((*MockClientInterface)(nil).BlockByHash), ctx, hash) } @@ -427,7 +432,7 @@ func (m *MockClientInterface) BlockByNumber(ctx context.Context, number *big.Int } // BlockByNumber indicates an expected call of BlockByNumber. -func (mr *MockClientInterfaceMockRecorder) BlockByNumber(ctx, number interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) BlockByNumber(ctx, number any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockByNumber", reflect.TypeOf((*MockClientInterface)(nil).BlockByNumber), ctx, number) } @@ -442,7 +447,7 @@ func (m *MockClientInterface) BlockNumber(ctx context.Context) (uint64, error) { } // BlockNumber indicates an expected call of BlockNumber. -func (mr *MockClientInterfaceMockRecorder) BlockNumber(ctx interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) BlockNumber(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockNumber", reflect.TypeOf((*MockClientInterface)(nil).BlockNumber), ctx) } @@ -457,15 +462,15 @@ func (m *MockClientInterface) CallBlockHashByTransaction(ctx context.Context, bl } // CallBlockHashByTransaction indicates an expected call of CallBlockHashByTransaction. -func (mr *MockClientInterfaceMockRecorder) CallBlockHashByTransaction(ctx, blockNumber, index interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) CallBlockHashByTransaction(ctx, blockNumber, index any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallBlockHashByTransaction", reflect.TypeOf((*MockClientInterface)(nil).CallBlockHashByTransaction), ctx, blockNumber, index) } // CallContext mocks base method. -func (m *MockClientInterface) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { +func (m *MockClientInterface) CallContext(ctx context.Context, result any, method string, args ...any) error { m.ctrl.T.Helper() - varargs := []interface{}{ctx, result, method} + varargs := []any{ctx, result, method} for _, a := range args { varargs = append(varargs, a) } @@ -475,9 +480,9 @@ func (m *MockClientInterface) CallContext(ctx context.Context, result interface{ } // CallContext indicates an expected call of CallContext. -func (mr *MockClientInterfaceMockRecorder) CallContext(ctx, result, method interface{}, args ...interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) CallContext(ctx, result, method any, args ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, result, method}, args...) + varargs := append([]any{ctx, result, method}, args...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallContext", reflect.TypeOf((*MockClientInterface)(nil).CallContext), varargs...) } @@ -491,7 +496,7 @@ func (m *MockClientInterface) CallContract(ctx context.Context, call ethereum.Ca } // CallContract indicates an expected call of CallContract. -func (mr *MockClientInterfaceMockRecorder) CallContract(ctx, call, blockNumber interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) CallContract(ctx, call, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallContract", reflect.TypeOf((*MockClientInterface)(nil).CallContract), ctx, call, blockNumber) } @@ -506,7 +511,7 @@ func (m *MockClientInterface) CodeAt(ctx context.Context, contract common.Addres } // CodeAt indicates an expected call of CodeAt. -func (mr *MockClientInterfaceMockRecorder) CodeAt(ctx, contract, blockNumber interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) CodeAt(ctx, contract, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CodeAt", reflect.TypeOf((*MockClientInterface)(nil).CodeAt), ctx, contract, blockNumber) } @@ -521,7 +526,7 @@ func (m *MockClientInterface) EstimateGas(ctx context.Context, call ethereum.Cal } // EstimateGas indicates an expected call of EstimateGas. -func (mr *MockClientInterfaceMockRecorder) EstimateGas(ctx, call interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) EstimateGas(ctx, call any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EstimateGas", reflect.TypeOf((*MockClientInterface)(nil).EstimateGas), ctx, call) } @@ -536,7 +541,7 @@ func (m *MockClientInterface) FilterLogs(ctx context.Context, q ethereum.FilterQ } // FilterLogs indicates an expected call of FilterLogs. -func (mr *MockClientInterfaceMockRecorder) FilterLogs(ctx, q interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) FilterLogs(ctx, q any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilterLogs", reflect.TypeOf((*MockClientInterface)(nil).FilterLogs), ctx, q) } @@ -551,7 +556,7 @@ func (m *MockClientInterface) GetBaseFeeFromBlock(ctx context.Context, blockNumb } // GetBaseFeeFromBlock indicates an expected call of GetBaseFeeFromBlock. -func (mr *MockClientInterfaceMockRecorder) GetBaseFeeFromBlock(ctx, blockNumber interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) GetBaseFeeFromBlock(ctx, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBaseFeeFromBlock", reflect.TypeOf((*MockClientInterface)(nil).GetBaseFeeFromBlock), ctx, blockNumber) } @@ -594,7 +599,7 @@ func (m *MockClientInterface) HeaderByHash(ctx context.Context, hash common.Hash } // HeaderByHash indicates an expected call of HeaderByHash. -func (mr *MockClientInterfaceMockRecorder) HeaderByHash(ctx, hash interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) HeaderByHash(ctx, hash any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeaderByHash", reflect.TypeOf((*MockClientInterface)(nil).HeaderByHash), ctx, hash) } @@ -609,7 +614,7 @@ func (m *MockClientInterface) HeaderByNumber(ctx context.Context, number *big.In } // HeaderByNumber indicates an expected call of HeaderByNumber. -func (mr *MockClientInterfaceMockRecorder) HeaderByNumber(ctx, number interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) HeaderByNumber(ctx, number any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeaderByNumber", reflect.TypeOf((*MockClientInterface)(nil).HeaderByNumber), ctx, number) } @@ -652,7 +657,7 @@ func (m *MockClientInterface) NonceAt(ctx context.Context, account common.Addres } // NonceAt indicates an expected call of NonceAt. -func (mr *MockClientInterfaceMockRecorder) NonceAt(ctx, account, blockNumber interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) NonceAt(ctx, account, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NonceAt", reflect.TypeOf((*MockClientInterface)(nil).NonceAt), ctx, account, blockNumber) } @@ -667,7 +672,7 @@ func (m *MockClientInterface) PendingCodeAt(ctx context.Context, account common. } // PendingCodeAt indicates an expected call of PendingCodeAt. -func (mr *MockClientInterfaceMockRecorder) PendingCodeAt(ctx, account interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) PendingCodeAt(ctx, account any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PendingCodeAt", reflect.TypeOf((*MockClientInterface)(nil).PendingCodeAt), ctx, account) } @@ -682,7 +687,7 @@ func (m *MockClientInterface) PendingNonceAt(ctx context.Context, account common } // PendingNonceAt indicates an expected call of PendingNonceAt. -func (mr *MockClientInterfaceMockRecorder) PendingNonceAt(ctx, account interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) PendingNonceAt(ctx, account any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PendingNonceAt", reflect.TypeOf((*MockClientInterface)(nil).PendingNonceAt), ctx, account) } @@ -696,7 +701,7 @@ func (m *MockClientInterface) SendTransaction(ctx context.Context, tx *types.Tra } // SendTransaction indicates an expected call of SendTransaction. -func (mr *MockClientInterfaceMockRecorder) SendTransaction(ctx, tx interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SendTransaction(ctx, tx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendTransaction", reflect.TypeOf((*MockClientInterface)(nil).SendTransaction), ctx, tx) } @@ -708,7 +713,7 @@ func (m *MockClientInterface) SetIsConnected(arg0 bool) { } // SetIsConnected indicates an expected call of SetIsConnected. -func (mr *MockClientInterfaceMockRecorder) SetIsConnected(arg0 interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SetIsConnected(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetIsConnected", reflect.TypeOf((*MockClientInterface)(nil).SetIsConnected), arg0) } @@ -720,7 +725,7 @@ func (m *MockClientInterface) SetLimiter(arg0 chain.RequestLimiter) { } // SetLimiter indicates an expected call of SetLimiter. -func (mr *MockClientInterfaceMockRecorder) SetLimiter(arg0 interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SetLimiter(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLimiter", reflect.TypeOf((*MockClientInterface)(nil).SetLimiter), arg0) } @@ -732,7 +737,7 @@ func (m *MockClientInterface) SetWalletNotifier(notifier func(uint64, string)) { } // SetWalletNotifier indicates an expected call of SetWalletNotifier. -func (mr *MockClientInterfaceMockRecorder) SetWalletNotifier(notifier interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SetWalletNotifier(notifier any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWalletNotifier", reflect.TypeOf((*MockClientInterface)(nil).SetWalletNotifier), notifier) } @@ -747,7 +752,7 @@ func (m *MockClientInterface) SubscribeFilterLogs(ctx context.Context, query eth } // SubscribeFilterLogs indicates an expected call of SubscribeFilterLogs. -func (mr *MockClientInterfaceMockRecorder) SubscribeFilterLogs(ctx, query, ch interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SubscribeFilterLogs(ctx, query, ch any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeFilterLogs", reflect.TypeOf((*MockClientInterface)(nil).SubscribeFilterLogs), ctx, query, ch) } @@ -762,7 +767,7 @@ func (m *MockClientInterface) SuggestGasPrice(ctx context.Context) (*big.Int, er } // SuggestGasPrice indicates an expected call of SuggestGasPrice. -func (mr *MockClientInterfaceMockRecorder) SuggestGasPrice(ctx interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SuggestGasPrice(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SuggestGasPrice", reflect.TypeOf((*MockClientInterface)(nil).SuggestGasPrice), ctx) } @@ -777,7 +782,7 @@ func (m *MockClientInterface) SuggestGasTipCap(ctx context.Context) (*big.Int, e } // SuggestGasTipCap indicates an expected call of SuggestGasTipCap. -func (mr *MockClientInterfaceMockRecorder) SuggestGasTipCap(ctx interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SuggestGasTipCap(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SuggestGasTipCap", reflect.TypeOf((*MockClientInterface)(nil).SuggestGasTipCap), ctx) } @@ -807,7 +812,7 @@ func (m *MockClientInterface) TransactionByHash(ctx context.Context, hash common } // TransactionByHash indicates an expected call of TransactionByHash. -func (mr *MockClientInterfaceMockRecorder) TransactionByHash(ctx, hash interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) TransactionByHash(ctx, hash any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionByHash", reflect.TypeOf((*MockClientInterface)(nil).TransactionByHash), ctx, hash) } @@ -822,7 +827,7 @@ func (m *MockClientInterface) TransactionReceipt(ctx context.Context, txHash com } // TransactionReceipt indicates an expected call of TransactionReceipt. -func (mr *MockClientInterfaceMockRecorder) TransactionReceipt(ctx, txHash interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) TransactionReceipt(ctx, txHash any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionReceipt", reflect.TypeOf((*MockClientInterface)(nil).TransactionReceipt), ctx, txHash) } @@ -885,7 +890,7 @@ func (m *MockTagger) SetGroupTag(tag string) { } // SetGroupTag indicates an expected call of SetGroupTag. -func (mr *MockTaggerMockRecorder) SetGroupTag(tag interface{}) *gomock.Call { +func (mr *MockTaggerMockRecorder) SetGroupTag(tag any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetGroupTag", reflect.TypeOf((*MockTagger)(nil).SetGroupTag), tag) } @@ -897,7 +902,7 @@ func (m *MockTagger) SetTag(tag string) { } // SetTag indicates an expected call of SetTag. -func (mr *MockTaggerMockRecorder) SetTag(tag interface{}) *gomock.Call { +func (mr *MockTaggerMockRecorder) SetTag(tag any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTag", reflect.TypeOf((*MockTagger)(nil).SetTag), tag) } @@ -915,3 +920,89 @@ func (mr *MockTaggerMockRecorder) Tag() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tag", reflect.TypeOf((*MockTagger)(nil).Tag)) } + +// MockHealthMonitor is a mock of HealthMonitor interface. +type MockHealthMonitor struct { + ctrl *gomock.Controller + recorder *MockHealthMonitorMockRecorder +} + +// MockHealthMonitorMockRecorder is the mock recorder for MockHealthMonitor. +type MockHealthMonitorMockRecorder struct { + mock *MockHealthMonitor +} + +// NewMockHealthMonitor creates a new mock instance. +func NewMockHealthMonitor(ctrl *gomock.Controller) *MockHealthMonitor { + mock := &MockHealthMonitor{ctrl: ctrl} + mock.recorder = &MockHealthMonitorMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockHealthMonitor) EXPECT() *MockHealthMonitorMockRecorder { + return m.recorder +} + +// GetCircuitBreaker mocks base method. +func (m *MockHealthMonitor) GetCircuitBreaker() *circuitbreaker.CircuitBreaker { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCircuitBreaker") + ret0, _ := ret[0].(*circuitbreaker.CircuitBreaker) + return ret0 +} + +// GetCircuitBreaker indicates an expected call of GetCircuitBreaker. +func (mr *MockHealthMonitorMockRecorder) GetCircuitBreaker() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCircuitBreaker", reflect.TypeOf((*MockHealthMonitor)(nil).GetCircuitBreaker)) +} + +// SetCircuitBreaker mocks base method. +func (m *MockHealthMonitor) SetCircuitBreaker(cb *circuitbreaker.CircuitBreaker) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetCircuitBreaker", cb) +} + +// SetCircuitBreaker indicates an expected call of SetCircuitBreaker. +func (mr *MockHealthMonitorMockRecorder) SetCircuitBreaker(cb any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCircuitBreaker", reflect.TypeOf((*MockHealthMonitor)(nil).SetCircuitBreaker), cb) +} + +// MockCopyable is a mock of Copyable interface. +type MockCopyable struct { + ctrl *gomock.Controller + recorder *MockCopyableMockRecorder +} + +// MockCopyableMockRecorder is the mock recorder for MockCopyable. +type MockCopyableMockRecorder struct { + mock *MockCopyable +} + +// NewMockCopyable creates a new mock instance. +func NewMockCopyable(ctrl *gomock.Controller) *MockCopyable { + mock := &MockCopyable{ctrl: ctrl} + mock.recorder = &MockCopyableMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockCopyable) EXPECT() *MockCopyableMockRecorder { + return m.recorder +} + +// Copy mocks base method. +func (m *MockCopyable) Copy() any { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Copy") + ret0, _ := ret[0].(any) + return ret0 +} + +// Copy indicates an expected call of Copy. +func (mr *MockCopyableMockRecorder) Copy() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Copy", reflect.TypeOf((*MockCopyable)(nil).Copy)) +} diff --git a/rpc/mock/client/client.go b/rpc/mock/client/client.go index b352c78c9..e7af522e9 100644 --- a/rpc/mock/client/client.go +++ b/rpc/mock/client/client.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: rpc/client.go +// +// Generated by this command: +// +// mockgen -package=mock_rpcclient -destination=rpc/mock/client/client.go -source=rpc/client.go +// // Package mock_rpcclient is a generated GoMock package. package mock_rpcclient @@ -8,10 +13,9 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" - chain "github.com/status-im/status-go/rpc/chain" common "github.com/status-im/status-go/services/wallet/common" + gomock "go.uber.org/mock/gomock" ) // MockClientInterface is a mock of ClientInterface interface. @@ -47,15 +51,15 @@ func (m *MockClientInterface) AbstractEthClient(chainID common.ChainID) (chain.B } // AbstractEthClient indicates an expected call of AbstractEthClient. -func (mr *MockClientInterfaceMockRecorder) AbstractEthClient(chainID interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) AbstractEthClient(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AbstractEthClient", reflect.TypeOf((*MockClientInterface)(nil).AbstractEthClient), chainID) } // CallContext mocks base method. -func (m *MockClientInterface) CallContext(context context.Context, result interface{}, chainID uint64, method string, args ...interface{}) error { +func (m *MockClientInterface) CallContext(context context.Context, result any, chainID uint64, method string, args ...any) error { m.ctrl.T.Helper() - varargs := []interface{}{context, result, chainID, method} + varargs := []any{context, result, chainID, method} for _, a := range args { varargs = append(varargs, a) } @@ -65,9 +69,9 @@ func (m *MockClientInterface) CallContext(context context.Context, result interf } // CallContext indicates an expected call of CallContext. -func (mr *MockClientInterfaceMockRecorder) CallContext(context, result, chainID, method interface{}, args ...interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) CallContext(context, result, chainID, method any, args ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{context, result, chainID, method}, args...) + varargs := append([]any{context, result, chainID, method}, args...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallContext", reflect.TypeOf((*MockClientInterface)(nil).CallContext), varargs...) } @@ -81,7 +85,7 @@ func (m *MockClientInterface) EthClient(chainID uint64) (chain.ClientInterface, } // EthClient indicates an expected call of EthClient. -func (mr *MockClientInterfaceMockRecorder) EthClient(chainID interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) EthClient(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthClient", reflect.TypeOf((*MockClientInterface)(nil).EthClient), chainID) } @@ -96,7 +100,7 @@ func (m *MockClientInterface) EthClients(chainIDs []uint64) (map[uint64]chain.Cl } // EthClients indicates an expected call of EthClients. -func (mr *MockClientInterfaceMockRecorder) EthClients(chainIDs interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) EthClients(chainIDs any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthClients", reflect.TypeOf((*MockClientInterface)(nil).EthClients), chainIDs) } diff --git a/rpc/network/mock/network.go b/rpc/network/mock/network.go index b334b5aee..36e3999c2 100644 --- a/rpc/network/mock/network.go +++ b/rpc/network/mock/network.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: rpc/network/network.go +// +// Generated by this command: +// +// mockgen -package=mock_network -destination=rpc/network/mock/network.go -source=rpc/network/network.go +// // Package mock_network is a generated GoMock package. package mock_network @@ -7,9 +12,8 @@ package mock_network import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" - params "github.com/status-im/status-go/params" + gomock "go.uber.org/mock/gomock" ) // MockManagerInterface is a mock of ManagerInterface interface. @@ -44,7 +48,7 @@ func (m *MockManagerInterface) Find(chainID uint64) *params.Network { } // Find indicates an expected call of Find. -func (mr *MockManagerInterfaceMockRecorder) Find(chainID interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) Find(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockManagerInterface)(nil).Find), chainID) } @@ -59,7 +63,7 @@ func (m *MockManagerInterface) Get(onlyEnabled bool) ([]*params.Network, error) } // Get indicates an expected call of Get. -func (mr *MockManagerInterfaceMockRecorder) Get(onlyEnabled interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) Get(onlyEnabled any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockManagerInterface)(nil).Get), onlyEnabled) } diff --git a/services/connector/api_test.go b/services/connector/api_test.go index 9483d5bc6..f4925bb34 100644 --- a/services/connector/api_test.go +++ b/services/connector/api_test.go @@ -4,8 +4,8 @@ import ( "database/sql" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" gethrpc "github.com/ethereum/go-ethereum/rpc" diff --git a/services/connector/service_test.go b/services/connector/service_test.go index 096c8f4a9..3b1cc9056 100644 --- a/services/connector/service_test.go +++ b/services/connector/service_test.go @@ -3,9 +3,9 @@ package connector import ( "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" gethrpc "github.com/ethereum/go-ethereum/rpc" "github.com/status-im/status-go/params" diff --git a/services/ens/api_test.go b/services/ens/api_test.go index 86303798a..bcdd62c1a 100644 --- a/services/ens/api_test.go +++ b/services/ens/api_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/common" gethrpc "github.com/ethereum/go-ethereum/rpc" diff --git a/services/peer/api_test.go b/services/peer/api_test.go index a37cde6aa..4f690f3ed 100644 --- a/services/peer/api_test.go +++ b/services/peer/api_test.go @@ -5,8 +5,8 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" ) func TestPeerSuite(t *testing.T) { diff --git a/services/peer/discoverer_mock.go b/services/peer/discoverer_mock.go index f54e3b102..4b8d2690b 100644 --- a/services/peer/discoverer_mock.go +++ b/services/peer/discoverer_mock.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: services/peer/service.go +// +// Generated by this command: +// +// mockgen -package=peer -destination=services/peer/discoverer_mock.go -source=services/peer/service.go +// // Package peer is a generated GoMock package. package peer @@ -7,33 +12,33 @@ package peer import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) -// MockDiscoverer is a mock of Discoverer interface +// MockDiscoverer is a mock of Discoverer interface. type MockDiscoverer struct { ctrl *gomock.Controller recorder *MockDiscovererMockRecorder } -// MockDiscovererMockRecorder is the mock recorder for MockDiscoverer +// MockDiscovererMockRecorder is the mock recorder for MockDiscoverer. type MockDiscovererMockRecorder struct { mock *MockDiscoverer } -// NewMockDiscoverer creates a new mock instance +// NewMockDiscoverer creates a new mock instance. func NewMockDiscoverer(ctrl *gomock.Controller) *MockDiscoverer { mock := &MockDiscoverer{ctrl: ctrl} mock.recorder = &MockDiscovererMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockDiscoverer) EXPECT() *MockDiscovererMockRecorder { return m.recorder } -// Discover mocks base method +// Discover mocks base method. func (m *MockDiscoverer) Discover(topic string, max, min int) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Discover", topic, max, min) @@ -41,8 +46,8 @@ func (m *MockDiscoverer) Discover(topic string, max, min int) error { return ret0 } -// Discover indicates an expected call of Discover -func (mr *MockDiscovererMockRecorder) Discover(topic, max, min interface{}) *gomock.Call { +// Discover indicates an expected call of Discover. +func (mr *MockDiscovererMockRecorder) Discover(topic, max, min any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Discover", reflect.TypeOf((*MockDiscoverer)(nil).Discover), topic, max, min) } diff --git a/services/stickers/recent_test.go b/services/stickers/recent_test.go index 597ad78d9..71e5fc15e 100644 --- a/services/stickers/recent_test.go +++ b/services/stickers/recent_test.go @@ -6,9 +6,9 @@ import ( "math/big" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/status-im/status-go/multiaccounts/accounts" mock_settings "github.com/status-im/status-go/multiaccounts/settings/mocks" diff --git a/services/wallet/activity/service_test.go b/services/wallet/activity/service_test.go index 12ec7edea..07e7a19c7 100644 --- a/services/wallet/activity/service_test.go +++ b/services/wallet/activity/service_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" eth "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/event" diff --git a/services/wallet/collectibles/manager_test.go b/services/wallet/collectibles/manager_test.go index 2343aa700..028f60277 100644 --- a/services/wallet/collectibles/manager_test.go +++ b/services/wallet/collectibles/manager_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/common" "github.com/status-im/status-go/circuitbreaker" diff --git a/services/wallet/collectibles/mock/collectible_data_db.go b/services/wallet/collectibles/mock/collectible_data_db.go index 5db870908..77c9e86c6 100644 --- a/services/wallet/collectibles/mock/collectible_data_db.go +++ b/services/wallet/collectibles/mock/collectible_data_db.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: services/wallet/collectibles/collectible_data_db.go +// +// Generated by this command: +// +// mockgen -package=mock_collectibles -destination=services/wallet/collectibles/mock/collectible_data_db.go -source=services/wallet/collectibles/collectible_data_db.go +// // Package mock_collectibles is a generated GoMock package. package mock_collectibles @@ -7,9 +12,8 @@ package mock_collectibles import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" - thirdparty "github.com/status-im/status-go/services/wallet/thirdparty" + gomock "go.uber.org/mock/gomock" ) // MockCollectibleDataStorage is a mock of CollectibleDataStorage interface. @@ -45,7 +49,7 @@ func (m *MockCollectibleDataStorage) GetCommunityInfo(id thirdparty.CollectibleU } // GetCommunityInfo indicates an expected call of GetCommunityInfo. -func (mr *MockCollectibleDataStorageMockRecorder) GetCommunityInfo(id interface{}) *gomock.Call { +func (mr *MockCollectibleDataStorageMockRecorder) GetCommunityInfo(id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommunityInfo", reflect.TypeOf((*MockCollectibleDataStorage)(nil).GetCommunityInfo), id) } @@ -60,7 +64,7 @@ func (m *MockCollectibleDataStorage) GetData(ids []thirdparty.CollectibleUniqueI } // GetData indicates an expected call of GetData. -func (mr *MockCollectibleDataStorageMockRecorder) GetData(ids interface{}) *gomock.Call { +func (mr *MockCollectibleDataStorageMockRecorder) GetData(ids any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetData", reflect.TypeOf((*MockCollectibleDataStorage)(nil).GetData), ids) } @@ -75,7 +79,7 @@ func (m *MockCollectibleDataStorage) GetIDsNotInDB(ids []thirdparty.CollectibleU } // GetIDsNotInDB indicates an expected call of GetIDsNotInDB. -func (mr *MockCollectibleDataStorageMockRecorder) GetIDsNotInDB(ids interface{}) *gomock.Call { +func (mr *MockCollectibleDataStorageMockRecorder) GetIDsNotInDB(ids any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIDsNotInDB", reflect.TypeOf((*MockCollectibleDataStorage)(nil).GetIDsNotInDB), ids) } @@ -89,7 +93,7 @@ func (m *MockCollectibleDataStorage) SetCommunityInfo(id thirdparty.CollectibleU } // SetCommunityInfo indicates an expected call of SetCommunityInfo. -func (mr *MockCollectibleDataStorageMockRecorder) SetCommunityInfo(id, communityInfo interface{}) *gomock.Call { +func (mr *MockCollectibleDataStorageMockRecorder) SetCommunityInfo(id, communityInfo any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCommunityInfo", reflect.TypeOf((*MockCollectibleDataStorage)(nil).SetCommunityInfo), id, communityInfo) } @@ -103,7 +107,7 @@ func (m *MockCollectibleDataStorage) SetData(collectibles []thirdparty.Collectib } // SetData indicates an expected call of SetData. -func (mr *MockCollectibleDataStorageMockRecorder) SetData(collectibles, allowUpdate interface{}) *gomock.Call { +func (mr *MockCollectibleDataStorageMockRecorder) SetData(collectibles, allowUpdate any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetData", reflect.TypeOf((*MockCollectibleDataStorage)(nil).SetData), collectibles, allowUpdate) } diff --git a/services/wallet/collectibles/mock/collection_data_db.go b/services/wallet/collectibles/mock/collection_data_db.go index 877ba5a2c..1609e229a 100644 --- a/services/wallet/collectibles/mock/collection_data_db.go +++ b/services/wallet/collectibles/mock/collection_data_db.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: services/wallet/collectibles/collection_data_db.go +// +// Generated by this command: +// +// mockgen -package=mock_collectibles -destination=services/wallet/collectibles/mock/collection_data_db.go -source=services/wallet/collectibles/collection_data_db.go +// // Package mock_collectibles is a generated GoMock package. package mock_collectibles @@ -7,9 +12,8 @@ package mock_collectibles import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" - thirdparty "github.com/status-im/status-go/services/wallet/thirdparty" + gomock "go.uber.org/mock/gomock" ) // MockCollectionDataStorage is a mock of CollectionDataStorage interface. @@ -45,7 +49,7 @@ func (m *MockCollectionDataStorage) GetData(ids []thirdparty.ContractID) (map[st } // GetData indicates an expected call of GetData. -func (mr *MockCollectionDataStorageMockRecorder) GetData(ids interface{}) *gomock.Call { +func (mr *MockCollectionDataStorageMockRecorder) GetData(ids any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetData", reflect.TypeOf((*MockCollectionDataStorage)(nil).GetData), ids) } @@ -60,7 +64,7 @@ func (m *MockCollectionDataStorage) GetIDsNotInDB(ids []thirdparty.ContractID) ( } // GetIDsNotInDB indicates an expected call of GetIDsNotInDB. -func (mr *MockCollectionDataStorageMockRecorder) GetIDsNotInDB(ids interface{}) *gomock.Call { +func (mr *MockCollectionDataStorageMockRecorder) GetIDsNotInDB(ids any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIDsNotInDB", reflect.TypeOf((*MockCollectionDataStorage)(nil).GetIDsNotInDB), ids) } @@ -75,7 +79,7 @@ func (m *MockCollectionDataStorage) GetSocialsForID(contractID thirdparty.Contra } // GetSocialsForID indicates an expected call of GetSocialsForID. -func (mr *MockCollectionDataStorageMockRecorder) GetSocialsForID(contractID interface{}) *gomock.Call { +func (mr *MockCollectionDataStorageMockRecorder) GetSocialsForID(contractID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSocialsForID", reflect.TypeOf((*MockCollectionDataStorage)(nil).GetSocialsForID), contractID) } @@ -89,7 +93,7 @@ func (m *MockCollectionDataStorage) SetCollectionSocialsData(id thirdparty.Contr } // SetCollectionSocialsData indicates an expected call of SetCollectionSocialsData. -func (mr *MockCollectionDataStorageMockRecorder) SetCollectionSocialsData(id, collectionSocials interface{}) *gomock.Call { +func (mr *MockCollectionDataStorageMockRecorder) SetCollectionSocialsData(id, collectionSocials any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCollectionSocialsData", reflect.TypeOf((*MockCollectionDataStorage)(nil).SetCollectionSocialsData), id, collectionSocials) } @@ -103,7 +107,7 @@ func (m *MockCollectionDataStorage) SetData(collections []thirdparty.CollectionD } // SetData indicates an expected call of SetData. -func (mr *MockCollectionDataStorageMockRecorder) SetData(collections, allowUpdate interface{}) *gomock.Call { +func (mr *MockCollectionDataStorageMockRecorder) SetData(collections, allowUpdate any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetData", reflect.TypeOf((*MockCollectionDataStorage)(nil).SetData), collections, allowUpdate) } diff --git a/services/wallet/history/service_test.go b/services/wallet/history/service_test.go index 24da23355..248e7b4dd 100644 --- a/services/wallet/history/service_test.go +++ b/services/wallet/history/service_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" diff --git a/services/wallet/market/market_test.go b/services/wallet/market/market_test.go index 7ede01009..33113dfe6 100644 --- a/services/wallet/market/market_test.go +++ b/services/wallet/market/market_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/event" diff --git a/services/wallet/onramp/mock/types.go b/services/wallet/onramp/mock/types.go index d739cefbb..d00ab03ea 100644 --- a/services/wallet/onramp/mock/types.go +++ b/services/wallet/onramp/mock/types.go @@ -13,9 +13,8 @@ import ( context "context" reflect "reflect" - gomock "go.uber.org/mock/gomock" - onramp "github.com/status-im/status-go/services/wallet/onramp" + gomock "go.uber.org/mock/gomock" ) // MockProvider is a mock of Provider interface. diff --git a/services/wallet/reader_test.go b/services/wallet/reader_test.go index c4a98d7b7..ea036adbd 100644 --- a/services/wallet/reader_test.go +++ b/services/wallet/reader_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" diff --git a/services/wallet/router/pathprocessor/mock_pathprocessor/processor.go b/services/wallet/router/pathprocessor/mock_pathprocessor/processor.go index d4d949844..8c99858af 100644 --- a/services/wallet/router/pathprocessor/mock_pathprocessor/processor.go +++ b/services/wallet/router/pathprocessor/mock_pathprocessor/processor.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: services/wallet/router/pathprocessor/processor.go +// +// Generated by this command: +// +// mockgen -package=mock_pathprocessor -destination=services/wallet/router/pathprocessor/mock_pathprocessor/processor.go -source=services/wallet/router/pathprocessor/processor.go +// // Package mock_pathprocessor is a generated GoMock package. package mock_pathprocessor @@ -8,13 +13,12 @@ import ( big "math/big" reflect "reflect" - gomock "github.com/golang/mock/gomock" - common "github.com/ethereum/go-ethereum/common" types "github.com/ethereum/go-ethereum/core/types" account "github.com/status-im/status-go/account" types0 "github.com/status-im/status-go/eth-node/types" pathprocessor "github.com/status-im/status-go/services/wallet/router/pathprocessor" + gomock "go.uber.org/mock/gomock" ) // MockPathProcessor is a mock of PathProcessor interface. @@ -50,7 +54,7 @@ func (m *MockPathProcessor) AvailableFor(params pathprocessor.ProcessorInputPara } // AvailableFor indicates an expected call of AvailableFor. -func (mr *MockPathProcessorMockRecorder) AvailableFor(params interface{}) *gomock.Call { +func (mr *MockPathProcessorMockRecorder) AvailableFor(params any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AvailableFor", reflect.TypeOf((*MockPathProcessor)(nil).AvailableFor), params) } @@ -66,7 +70,7 @@ func (m *MockPathProcessor) BuildTransaction(sendArgs *pathprocessor.MultipathPr } // BuildTransaction indicates an expected call of BuildTransaction. -func (mr *MockPathProcessorMockRecorder) BuildTransaction(sendArgs, lastUsedNonce interface{}) *gomock.Call { +func (mr *MockPathProcessorMockRecorder) BuildTransaction(sendArgs, lastUsedNonce any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildTransaction", reflect.TypeOf((*MockPathProcessor)(nil).BuildTransaction), sendArgs, lastUsedNonce) } @@ -81,7 +85,7 @@ func (m *MockPathProcessor) CalculateAmountOut(params pathprocessor.ProcessorInp } // CalculateAmountOut indicates an expected call of CalculateAmountOut. -func (mr *MockPathProcessorMockRecorder) CalculateAmountOut(params interface{}) *gomock.Call { +func (mr *MockPathProcessorMockRecorder) CalculateAmountOut(params any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalculateAmountOut", reflect.TypeOf((*MockPathProcessor)(nil).CalculateAmountOut), params) } @@ -97,7 +101,7 @@ func (m *MockPathProcessor) CalculateFees(params pathprocessor.ProcessorInputPar } // CalculateFees indicates an expected call of CalculateFees. -func (mr *MockPathProcessorMockRecorder) CalculateFees(params interface{}) *gomock.Call { +func (mr *MockPathProcessorMockRecorder) CalculateFees(params any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalculateFees", reflect.TypeOf((*MockPathProcessor)(nil).CalculateFees), params) } @@ -112,7 +116,7 @@ func (m *MockPathProcessor) EstimateGas(params pathprocessor.ProcessorInputParam } // EstimateGas indicates an expected call of EstimateGas. -func (mr *MockPathProcessorMockRecorder) EstimateGas(params interface{}) *gomock.Call { +func (mr *MockPathProcessorMockRecorder) EstimateGas(params any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EstimateGas", reflect.TypeOf((*MockPathProcessor)(nil).EstimateGas), params) } @@ -127,7 +131,7 @@ func (m *MockPathProcessor) GetContractAddress(params pathprocessor.ProcessorInp } // GetContractAddress indicates an expected call of GetContractAddress. -func (mr *MockPathProcessorMockRecorder) GetContractAddress(params interface{}) *gomock.Call { +func (mr *MockPathProcessorMockRecorder) GetContractAddress(params any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetContractAddress", reflect.TypeOf((*MockPathProcessor)(nil).GetContractAddress), params) } @@ -156,7 +160,7 @@ func (m *MockPathProcessor) PackTxInputData(params pathprocessor.ProcessorInputP } // PackTxInputData indicates an expected call of PackTxInputData. -func (mr *MockPathProcessorMockRecorder) PackTxInputData(params interface{}) *gomock.Call { +func (mr *MockPathProcessorMockRecorder) PackTxInputData(params any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PackTxInputData", reflect.TypeOf((*MockPathProcessor)(nil).PackTxInputData), params) } @@ -172,7 +176,7 @@ func (m *MockPathProcessor) Send(sendArgs *pathprocessor.MultipathProcessorTxArg } // Send indicates an expected call of Send. -func (mr *MockPathProcessorMockRecorder) Send(sendArgs, lastUsedNonce, verifiedAccount interface{}) *gomock.Call { +func (mr *MockPathProcessorMockRecorder) Send(sendArgs, lastUsedNonce, verifiedAccount any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockPathProcessor)(nil).Send), sendArgs, lastUsedNonce, verifiedAccount) } diff --git a/services/wallet/router/pathprocessor/processor_swap_paraswap_test.go b/services/wallet/router/pathprocessor/processor_swap_paraswap_test.go index d5c2b896c..578efb5ce 100644 --- a/services/wallet/router/pathprocessor/processor_swap_paraswap_test.go +++ b/services/wallet/router/pathprocessor/processor_swap_paraswap_test.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" "github.com/status-im/status-go/params" "github.com/status-im/status-go/services/wallet/bigint" diff --git a/services/wallet/testutils/helpers.go b/services/wallet/testutils/helpers.go index d419dae5d..c87b08dd6 100644 --- a/services/wallet/testutils/helpers.go +++ b/services/wallet/testutils/helpers.go @@ -4,7 +4,7 @@ import ( "reflect" "sort" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/common" ) diff --git a/services/wallet/thirdparty/mock/collectible_types.go b/services/wallet/thirdparty/mock/collectible_types.go index b4eb29fdd..6c27af8aa 100644 --- a/services/wallet/thirdparty/mock/collectible_types.go +++ b/services/wallet/thirdparty/mock/collectible_types.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: services/wallet/thirdparty/collectible_types.go +// +// Generated by this command: +// +// mockgen -package=mock_thirdparty -destination=services/wallet/thirdparty/mock/collectible_types.go -source=services/wallet/thirdparty/collectible_types.go +// // Package mock_thirdparty is a generated GoMock package. package mock_thirdparty @@ -8,11 +13,10 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" - common "github.com/ethereum/go-ethereum/common" common0 "github.com/status-im/status-go/services/wallet/common" thirdparty "github.com/status-im/status-go/services/wallet/thirdparty" + gomock "go.uber.org/mock/gomock" ) // MockCollectibleProvider is a mock of CollectibleProvider interface. @@ -61,7 +65,7 @@ func (m *MockCollectibleProvider) IsChainSupported(chainID common0.ChainID) bool } // IsChainSupported indicates an expected call of IsChainSupported. -func (mr *MockCollectibleProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call { +func (mr *MockCollectibleProviderMockRecorder) IsChainSupported(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleProvider)(nil).IsChainSupported), chainID) } @@ -113,7 +117,7 @@ func (m *MockCollectibleContractOwnershipProvider) FetchCollectibleOwnersByContr } // FetchCollectibleOwnersByContractAddress indicates an expected call of FetchCollectibleOwnersByContractAddress. -func (mr *MockCollectibleContractOwnershipProviderMockRecorder) FetchCollectibleOwnersByContractAddress(ctx, chainID, contractAddress interface{}) *gomock.Call { +func (mr *MockCollectibleContractOwnershipProviderMockRecorder) FetchCollectibleOwnersByContractAddress(ctx, chainID, contractAddress any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCollectibleOwnersByContractAddress", reflect.TypeOf((*MockCollectibleContractOwnershipProvider)(nil).FetchCollectibleOwnersByContractAddress), ctx, chainID, contractAddress) } @@ -141,7 +145,7 @@ func (m *MockCollectibleContractOwnershipProvider) IsChainSupported(chainID comm } // IsChainSupported indicates an expected call of IsChainSupported. -func (mr *MockCollectibleContractOwnershipProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call { +func (mr *MockCollectibleContractOwnershipProviderMockRecorder) IsChainSupported(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleContractOwnershipProvider)(nil).IsChainSupported), chainID) } @@ -193,7 +197,7 @@ func (m *MockCollectibleAccountOwnershipProvider) FetchAllAssetsByOwner(ctx cont } // FetchAllAssetsByOwner indicates an expected call of FetchAllAssetsByOwner. -func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) FetchAllAssetsByOwner(ctx, chainID, owner, cursor, limit interface{}) *gomock.Call { +func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) FetchAllAssetsByOwner(ctx, chainID, owner, cursor, limit any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchAllAssetsByOwner", reflect.TypeOf((*MockCollectibleAccountOwnershipProvider)(nil).FetchAllAssetsByOwner), ctx, chainID, owner, cursor, limit) } @@ -208,7 +212,7 @@ func (m *MockCollectibleAccountOwnershipProvider) FetchAllAssetsByOwnerAndContra } // FetchAllAssetsByOwnerAndContractAddress indicates an expected call of FetchAllAssetsByOwnerAndContractAddress. -func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) FetchAllAssetsByOwnerAndContractAddress(ctx, chainID, owner, contractAddresses, cursor, limit interface{}) *gomock.Call { +func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) FetchAllAssetsByOwnerAndContractAddress(ctx, chainID, owner, contractAddresses, cursor, limit any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchAllAssetsByOwnerAndContractAddress", reflect.TypeOf((*MockCollectibleAccountOwnershipProvider)(nil).FetchAllAssetsByOwnerAndContractAddress), ctx, chainID, owner, contractAddresses, cursor, limit) } @@ -236,7 +240,7 @@ func (m *MockCollectibleAccountOwnershipProvider) IsChainSupported(chainID commo } // IsChainSupported indicates an expected call of IsChainSupported. -func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call { +func (mr *MockCollectibleAccountOwnershipProviderMockRecorder) IsChainSupported(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleAccountOwnershipProvider)(nil).IsChainSupported), chainID) } @@ -288,7 +292,7 @@ func (m *MockCollectibleDataProvider) FetchAssetsByCollectibleUniqueID(ctx conte } // FetchAssetsByCollectibleUniqueID indicates an expected call of FetchAssetsByCollectibleUniqueID. -func (mr *MockCollectibleDataProviderMockRecorder) FetchAssetsByCollectibleUniqueID(ctx, uniqueIDs interface{}) *gomock.Call { +func (mr *MockCollectibleDataProviderMockRecorder) FetchAssetsByCollectibleUniqueID(ctx, uniqueIDs any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchAssetsByCollectibleUniqueID", reflect.TypeOf((*MockCollectibleDataProvider)(nil).FetchAssetsByCollectibleUniqueID), ctx, uniqueIDs) } @@ -303,7 +307,7 @@ func (m *MockCollectibleDataProvider) FetchCollectionSocials(ctx context.Context } // FetchCollectionSocials indicates an expected call of FetchCollectionSocials. -func (mr *MockCollectibleDataProviderMockRecorder) FetchCollectionSocials(ctx, contractID interface{}) *gomock.Call { +func (mr *MockCollectibleDataProviderMockRecorder) FetchCollectionSocials(ctx, contractID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCollectionSocials", reflect.TypeOf((*MockCollectibleDataProvider)(nil).FetchCollectionSocials), ctx, contractID) } @@ -331,7 +335,7 @@ func (m *MockCollectibleDataProvider) IsChainSupported(chainID common0.ChainID) } // IsChainSupported indicates an expected call of IsChainSupported. -func (mr *MockCollectibleDataProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call { +func (mr *MockCollectibleDataProviderMockRecorder) IsChainSupported(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleDataProvider)(nil).IsChainSupported), chainID) } @@ -383,7 +387,7 @@ func (m *MockCollectionDataProvider) FetchCollectionsDataByContractID(ctx contex } // FetchCollectionsDataByContractID indicates an expected call of FetchCollectionsDataByContractID. -func (mr *MockCollectionDataProviderMockRecorder) FetchCollectionsDataByContractID(ctx, ids interface{}) *gomock.Call { +func (mr *MockCollectionDataProviderMockRecorder) FetchCollectionsDataByContractID(ctx, ids any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCollectionsDataByContractID", reflect.TypeOf((*MockCollectionDataProvider)(nil).FetchCollectionsDataByContractID), ctx, ids) } @@ -411,7 +415,7 @@ func (m *MockCollectionDataProvider) IsChainSupported(chainID common0.ChainID) b } // IsChainSupported indicates an expected call of IsChainSupported. -func (mr *MockCollectionDataProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call { +func (mr *MockCollectionDataProviderMockRecorder) IsChainSupported(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectionDataProvider)(nil).IsChainSupported), chainID) } @@ -476,7 +480,7 @@ func (m *MockCollectibleSearchProvider) IsChainSupported(chainID common0.ChainID } // IsChainSupported indicates an expected call of IsChainSupported. -func (mr *MockCollectibleSearchProviderMockRecorder) IsChainSupported(chainID interface{}) *gomock.Call { +func (mr *MockCollectibleSearchProviderMockRecorder) IsChainSupported(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsChainSupported", reflect.TypeOf((*MockCollectibleSearchProvider)(nil).IsChainSupported), chainID) } @@ -505,7 +509,7 @@ func (m *MockCollectibleSearchProvider) SearchCollectibles(ctx context.Context, } // SearchCollectibles indicates an expected call of SearchCollectibles. -func (mr *MockCollectibleSearchProviderMockRecorder) SearchCollectibles(ctx, chainID, collections, text, cursor, limit interface{}) *gomock.Call { +func (mr *MockCollectibleSearchProviderMockRecorder) SearchCollectibles(ctx, chainID, collections, text, cursor, limit any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchCollectibles", reflect.TypeOf((*MockCollectibleSearchProvider)(nil).SearchCollectibles), ctx, chainID, collections, text, cursor, limit) } @@ -520,7 +524,7 @@ func (m *MockCollectibleSearchProvider) SearchCollections(ctx context.Context, c } // SearchCollections indicates an expected call of SearchCollections. -func (mr *MockCollectibleSearchProviderMockRecorder) SearchCollections(ctx, chainID, text, cursor, limit interface{}) *gomock.Call { +func (mr *MockCollectibleSearchProviderMockRecorder) SearchCollections(ctx, chainID, text, cursor, limit any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SearchCollections", reflect.TypeOf((*MockCollectibleSearchProvider)(nil).SearchCollections), ctx, chainID, text, cursor, limit) } diff --git a/services/wallet/thirdparty/mock/types.go b/services/wallet/thirdparty/mock/types.go index f3f29d76e..b34c2f78b 100644 --- a/services/wallet/thirdparty/mock/types.go +++ b/services/wallet/thirdparty/mock/types.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: services/wallet/thirdparty/types.go +// +// Generated by this command: +// +// mockgen -package=mock_thirdparty -destination=services/wallet/thirdparty/mock/types.go -source=services/wallet/thirdparty/types.go +// // Package mock_thirdparty is a generated GoMock package. package mock_thirdparty @@ -7,9 +12,8 @@ package mock_thirdparty import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" - thirdparty "github.com/status-im/status-go/services/wallet/thirdparty" + gomock "go.uber.org/mock/gomock" ) // MockMarketDataProvider is a mock of MarketDataProvider interface. @@ -45,7 +49,7 @@ func (m *MockMarketDataProvider) FetchHistoricalDailyPrices(symbol, currency str } // FetchHistoricalDailyPrices indicates an expected call of FetchHistoricalDailyPrices. -func (mr *MockMarketDataProviderMockRecorder) FetchHistoricalDailyPrices(symbol, currency, limit, allData, aggregate interface{}) *gomock.Call { +func (mr *MockMarketDataProviderMockRecorder) FetchHistoricalDailyPrices(symbol, currency, limit, allData, aggregate any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchHistoricalDailyPrices", reflect.TypeOf((*MockMarketDataProvider)(nil).FetchHistoricalDailyPrices), symbol, currency, limit, allData, aggregate) } @@ -60,7 +64,7 @@ func (m *MockMarketDataProvider) FetchHistoricalHourlyPrices(symbol, currency st } // FetchHistoricalHourlyPrices indicates an expected call of FetchHistoricalHourlyPrices. -func (mr *MockMarketDataProviderMockRecorder) FetchHistoricalHourlyPrices(symbol, currency, limit, aggregate interface{}) *gomock.Call { +func (mr *MockMarketDataProviderMockRecorder) FetchHistoricalHourlyPrices(symbol, currency, limit, aggregate any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchHistoricalHourlyPrices", reflect.TypeOf((*MockMarketDataProvider)(nil).FetchHistoricalHourlyPrices), symbol, currency, limit, aggregate) } @@ -75,7 +79,7 @@ func (m *MockMarketDataProvider) FetchPrices(symbols, currencies []string) (map[ } // FetchPrices indicates an expected call of FetchPrices. -func (mr *MockMarketDataProviderMockRecorder) FetchPrices(symbols, currencies interface{}) *gomock.Call { +func (mr *MockMarketDataProviderMockRecorder) FetchPrices(symbols, currencies any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchPrices", reflect.TypeOf((*MockMarketDataProvider)(nil).FetchPrices), symbols, currencies) } @@ -90,7 +94,7 @@ func (m *MockMarketDataProvider) FetchTokenDetails(symbols []string) (map[string } // FetchTokenDetails indicates an expected call of FetchTokenDetails. -func (mr *MockMarketDataProviderMockRecorder) FetchTokenDetails(symbols interface{}) *gomock.Call { +func (mr *MockMarketDataProviderMockRecorder) FetchTokenDetails(symbols any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchTokenDetails", reflect.TypeOf((*MockMarketDataProvider)(nil).FetchTokenDetails), symbols) } @@ -105,7 +109,7 @@ func (m *MockMarketDataProvider) FetchTokenMarketValues(symbols []string, curren } // FetchTokenMarketValues indicates an expected call of FetchTokenMarketValues. -func (mr *MockMarketDataProviderMockRecorder) FetchTokenMarketValues(symbols, currency interface{}) *gomock.Call { +func (mr *MockMarketDataProviderMockRecorder) FetchTokenMarketValues(symbols, currency any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchTokenMarketValues", reflect.TypeOf((*MockMarketDataProvider)(nil).FetchTokenMarketValues), symbols, currency) } @@ -157,7 +161,7 @@ func (m *MockDecoderProvider) Run(data string) (*thirdparty.DataParsed, error) { } // Run indicates an expected call of Run. -func (mr *MockDecoderProviderMockRecorder) Run(data interface{}) *gomock.Call { +func (mr *MockDecoderProviderMockRecorder) Run(data any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockDecoderProvider)(nil).Run), data) } diff --git a/services/wallet/thirdparty/paraswap/mock/types.go b/services/wallet/thirdparty/paraswap/mock/types.go index 9f3845005..07b052cf6 100644 --- a/services/wallet/thirdparty/paraswap/mock/types.go +++ b/services/wallet/thirdparty/paraswap/mock/types.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: services/wallet/thirdparty/paraswap/types.go +// +// Generated by this command: +// +// mockgen -package=mock_paraswap -destination=services/wallet/thirdparty/paraswap/mock/types.go -source=services/wallet/thirdparty/paraswap/types.go +// // Package mock_paraswap is a generated GoMock package. package mock_paraswap @@ -10,10 +15,9 @@ import ( big "math/big" reflect "reflect" - gomock "github.com/golang/mock/gomock" - common "github.com/ethereum/go-ethereum/common" paraswap "github.com/status-im/status-go/services/wallet/thirdparty/paraswap" + gomock "go.uber.org/mock/gomock" ) // MockClientInterface is a mock of ClientInterface interface. @@ -49,7 +53,7 @@ func (m *MockClientInterface) BuildTransaction(ctx context.Context, srcTokenAddr } // BuildTransaction indicates an expected call of BuildTransaction. -func (mr *MockClientInterfaceMockRecorder) BuildTransaction(ctx, srcTokenAddress, srcTokenDecimals, srcAmountWei, destTokenAddress, destTokenDecimals, destAmountWei, slippageBasisPoints, addressFrom, addressTo, priceRoute, side interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) BuildTransaction(ctx, srcTokenAddress, srcTokenDecimals, srcAmountWei, destTokenAddress, destTokenDecimals, destAmountWei, slippageBasisPoints, addressFrom, addressTo, priceRoute, side any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildTransaction", reflect.TypeOf((*MockClientInterface)(nil).BuildTransaction), ctx, srcTokenAddress, srcTokenDecimals, srcAmountWei, destTokenAddress, destTokenDecimals, destAmountWei, slippageBasisPoints, addressFrom, addressTo, priceRoute, side) } @@ -64,7 +68,7 @@ func (m *MockClientInterface) FetchPriceRoute(ctx context.Context, srcTokenAddre } // FetchPriceRoute indicates an expected call of FetchPriceRoute. -func (mr *MockClientInterfaceMockRecorder) FetchPriceRoute(ctx, srcTokenAddress, srcTokenDecimals, destTokenAddress, destTokenDecimals, amountWei, addressFrom, addressTo, side interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) FetchPriceRoute(ctx, srcTokenAddress, srcTokenDecimals, destTokenAddress, destTokenDecimals, amountWei, addressFrom, addressTo, side any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchPriceRoute", reflect.TypeOf((*MockClientInterface)(nil).FetchPriceRoute), ctx, srcTokenAddress, srcTokenDecimals, destTokenAddress, destTokenDecimals, amountWei, addressFrom, addressTo, side) } @@ -79,7 +83,7 @@ func (m *MockClientInterface) FetchTokensList(ctx context.Context) ([]paraswap.T } // FetchTokensList indicates an expected call of FetchTokensList. -func (mr *MockClientInterfaceMockRecorder) FetchTokensList(ctx interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) FetchTokensList(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchTokensList", reflect.TypeOf((*MockClientInterface)(nil).FetchTokensList), ctx) } @@ -91,7 +95,7 @@ func (m *MockClientInterface) SetChainID(chainID uint64) { } // SetChainID indicates an expected call of SetChainID. -func (mr *MockClientInterfaceMockRecorder) SetChainID(chainID interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SetChainID(chainID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetChainID", reflect.TypeOf((*MockClientInterface)(nil).SetChainID), chainID) } @@ -103,7 +107,7 @@ func (m *MockClientInterface) SetPartnerAddress(partnerAddress common.Address) { } // SetPartnerAddress indicates an expected call of SetPartnerAddress. -func (mr *MockClientInterfaceMockRecorder) SetPartnerAddress(partnerAddress interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SetPartnerAddress(partnerAddress any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPartnerAddress", reflect.TypeOf((*MockClientInterface)(nil).SetPartnerAddress), partnerAddress) } @@ -115,7 +119,7 @@ func (m *MockClientInterface) SetPartnerFeePcnt(partnerFeePcnt float64) { } // SetPartnerFeePcnt indicates an expected call of SetPartnerFeePcnt. -func (mr *MockClientInterfaceMockRecorder) SetPartnerFeePcnt(partnerFeePcnt interface{}) *gomock.Call { +func (mr *MockClientInterfaceMockRecorder) SetPartnerFeePcnt(partnerFeePcnt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPartnerFeePcnt", reflect.TypeOf((*MockClientInterface)(nil).SetPartnerFeePcnt), partnerFeePcnt) } diff --git a/services/wallet/token/balancefetcher/balance_fetcher_test.go b/services/wallet/token/balancefetcher/balance_fetcher_test.go index f048cc578..90235ae33 100644 --- a/services/wallet/token/balancefetcher/balance_fetcher_test.go +++ b/services/wallet/token/balancefetcher/balance_fetcher_test.go @@ -7,8 +7,8 @@ import ( "os" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" diff --git a/services/wallet/token/mock/balance_persistence/balance_persistence.go b/services/wallet/token/mock/balance_persistence/balance_persistence.go index 8c297e1ec..91e173430 100644 --- a/services/wallet/token/mock/balance_persistence/balance_persistence.go +++ b/services/wallet/token/mock/balance_persistence/balance_persistence.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: services/wallet/token/balance_persistence.go +// +// Generated by this command: +// +// mockgen -package=mock_balance_persistence -destination=services/wallet/token/mock/balance_persistence/balance_persistence.go -source=services/wallet/token/balance_persistence.go +// // Package mock_balance_persistence is a generated GoMock package. package mock_balance_persistence @@ -7,50 +12,35 @@ package mock_balance_persistence import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" - common "github.com/ethereum/go-ethereum/common" token "github.com/status-im/status-go/services/wallet/token" + gomock "go.uber.org/mock/gomock" ) -// MockTokenBalancesStorage is a mock of TokenBalancesStorage interface +// MockTokenBalancesStorage is a mock of TokenBalancesStorage interface. type MockTokenBalancesStorage struct { ctrl *gomock.Controller recorder *MockTokenBalancesStorageMockRecorder } -// MockTokenBalancesStorageMockRecorder is the mock recorder for MockTokenBalancesStorage +// MockTokenBalancesStorageMockRecorder is the mock recorder for MockTokenBalancesStorage. type MockTokenBalancesStorageMockRecorder struct { mock *MockTokenBalancesStorage } -// NewMockTokenBalancesStorage creates a new mock instance +// NewMockTokenBalancesStorage creates a new mock instance. func NewMockTokenBalancesStorage(ctrl *gomock.Controller) *MockTokenBalancesStorage { mock := &MockTokenBalancesStorage{ctrl: ctrl} mock.recorder = &MockTokenBalancesStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockTokenBalancesStorage) EXPECT() *MockTokenBalancesStorageMockRecorder { return m.recorder } -// SaveTokens mocks base method -func (m *MockTokenBalancesStorage) SaveTokens(tokens map[common.Address][]token.StorageToken) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SaveTokens", tokens) - ret0, _ := ret[0].(error) - return ret0 -} - -// SaveTokens indicates an expected call of SaveTokens -func (mr *MockTokenBalancesStorageMockRecorder) SaveTokens(tokens interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveTokens", reflect.TypeOf((*MockTokenBalancesStorage)(nil).SaveTokens), tokens) -} - -// GetTokens mocks base method +// GetTokens mocks base method. func (m *MockTokenBalancesStorage) GetTokens() (map[common.Address][]token.StorageToken, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetTokens") @@ -59,8 +49,22 @@ func (m *MockTokenBalancesStorage) GetTokens() (map[common.Address][]token.Stora return ret0, ret1 } -// GetTokens indicates an expected call of GetTokens +// GetTokens indicates an expected call of GetTokens. func (mr *MockTokenBalancesStorageMockRecorder) GetTokens() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokens", reflect.TypeOf((*MockTokenBalancesStorage)(nil).GetTokens)) } + +// SaveTokens mocks base method. +func (m *MockTokenBalancesStorage) SaveTokens(tokens map[common.Address][]token.StorageToken) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SaveTokens", tokens) + ret0, _ := ret[0].(error) + return ret0 +} + +// SaveTokens indicates an expected call of SaveTokens. +func (mr *MockTokenBalancesStorageMockRecorder) SaveTokens(tokens any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveTokens", reflect.TypeOf((*MockTokenBalancesStorage)(nil).SaveTokens), tokens) +} diff --git a/services/wallet/token/mock/token/tokenmanager.go b/services/wallet/token/mock/token/tokenmanager.go index b69192267..07baf19a7 100644 --- a/services/wallet/token/mock/token/tokenmanager.go +++ b/services/wallet/token/mock/token/tokenmanager.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: services/wallet/token/token.go +// +// Generated by this command: +// +// mockgen -package=mock_token -destination=services/wallet/token/mock/token/tokenmanager.go -source=services/wallet/token/token.go +// // Package mock_token is a generated GoMock package. package mock_token @@ -9,12 +14,11 @@ import ( big "math/big" reflect "reflect" - gomock "github.com/golang/mock/gomock" - common "github.com/ethereum/go-ethereum/common" hexutil "github.com/ethereum/go-ethereum/common/hexutil" chain "github.com/status-im/status-go/rpc/chain" token "github.com/status-im/status-go/services/wallet/token" + gomock "go.uber.org/mock/gomock" ) // MockManagerInterface is a mock of ManagerInterface interface. @@ -40,21 +44,6 @@ func (m *MockManagerInterface) EXPECT() *MockManagerInterfaceMockRecorder { return m.recorder } -// FetchBalancesForChain mocks base method. -func (m *MockManagerInterface) FetchBalancesForChain(parent context.Context, client chain.ClientInterface, accounts, tokens []common.Address, atBlock *big.Int) (map[common.Address]map[common.Address]*hexutil.Big, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FetchBalancesForChain", parent, client, accounts, tokens, atBlock) - ret0, _ := ret[0].(map[common.Address]map[common.Address]*hexutil.Big) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FetchBalancesForChain indicates an expected call of FetchBalancesForChain. -func (mr *MockManagerInterfaceMockRecorder) FetchBalancesForChain(parent, client, accounts, tokens, atBlock interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBalancesForChain", reflect.TypeOf((*MockManagerInterface)(nil).FetchBalancesForChain), parent, client, accounts, tokens, atBlock) -} - // GetBalance mocks base method. func (m *MockManagerInterface) GetBalance(ctx context.Context, client chain.ClientInterface, account, token common.Address) (*big.Int, error) { m.ctrl.T.Helper() @@ -65,7 +54,7 @@ func (m *MockManagerInterface) GetBalance(ctx context.Context, client chain.Clie } // GetBalance indicates an expected call of GetBalance. -func (mr *MockManagerInterfaceMockRecorder) GetBalance(ctx, client, account, token interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) GetBalance(ctx, client, account, token any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockManagerInterface)(nil).GetBalance), ctx, client, account, token) } @@ -80,7 +69,7 @@ func (m *MockManagerInterface) GetBalancesAtByChain(parent context.Context, clie } // GetBalancesAtByChain indicates an expected call of GetBalancesAtByChain. -func (mr *MockManagerInterfaceMockRecorder) GetBalancesAtByChain(parent, clients, accounts, tokens, atBlocks interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) GetBalancesAtByChain(parent, clients, accounts, tokens, atBlocks any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalancesAtByChain", reflect.TypeOf((*MockManagerInterface)(nil).GetBalancesAtByChain), parent, clients, accounts, tokens, atBlocks) } @@ -95,7 +84,7 @@ func (m *MockManagerInterface) GetBalancesByChain(parent context.Context, client } // GetBalancesByChain indicates an expected call of GetBalancesByChain. -func (mr *MockManagerInterfaceMockRecorder) GetBalancesByChain(parent, clients, accounts, tokens interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) GetBalancesByChain(parent, clients, accounts, tokens any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalancesByChain", reflect.TypeOf((*MockManagerInterface)(nil).GetBalancesByChain), parent, clients, accounts, tokens) } @@ -110,7 +99,7 @@ func (m *MockManagerInterface) GetChainBalance(ctx context.Context, client chain } // GetChainBalance indicates an expected call of GetChainBalance. -func (mr *MockManagerInterfaceMockRecorder) GetChainBalance(ctx, client, account interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) GetChainBalance(ctx, client, account any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainBalance", reflect.TypeOf((*MockManagerInterface)(nil).GetChainBalance), ctx, client, account) } @@ -125,7 +114,7 @@ func (m *MockManagerInterface) GetTokenBalanceAt(ctx context.Context, client cha } // GetTokenBalanceAt indicates an expected call of GetTokenBalanceAt. -func (mr *MockManagerInterfaceMockRecorder) GetTokenBalanceAt(ctx, client, account, token, blockNumber interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) GetTokenBalanceAt(ctx, client, account, token, blockNumber any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenBalanceAt", reflect.TypeOf((*MockManagerInterface)(nil).GetTokenBalanceAt), ctx, client, account, token, blockNumber) } @@ -140,7 +129,7 @@ func (m *MockManagerInterface) GetTokenHistoricalBalance(account common.Address, } // GetTokenHistoricalBalance indicates an expected call of GetTokenHistoricalBalance. -func (mr *MockManagerInterfaceMockRecorder) GetTokenHistoricalBalance(account, chainID, symbol, timestamp interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) GetTokenHistoricalBalance(account, chainID, symbol, timestamp any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenHistoricalBalance", reflect.TypeOf((*MockManagerInterface)(nil).GetTokenHistoricalBalance), account, chainID, symbol, timestamp) } @@ -155,7 +144,7 @@ func (m *MockManagerInterface) GetTokensByChainIDs(chainIDs []uint64) ([]*token. } // GetTokensByChainIDs indicates an expected call of GetTokensByChainIDs. -func (mr *MockManagerInterfaceMockRecorder) GetTokensByChainIDs(chainIDs interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) GetTokensByChainIDs(chainIDs any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokensByChainIDs", reflect.TypeOf((*MockManagerInterface)(nil).GetTokensByChainIDs), chainIDs) } @@ -170,7 +159,7 @@ func (m *MockManagerInterface) LookupToken(chainID *uint64, tokenSymbol string) } // LookupToken indicates an expected call of LookupToken. -func (mr *MockManagerInterfaceMockRecorder) LookupToken(chainID, tokenSymbol interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) LookupToken(chainID, tokenSymbol any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LookupToken", reflect.TypeOf((*MockManagerInterface)(nil).LookupToken), chainID, tokenSymbol) } @@ -184,7 +173,7 @@ func (m *MockManagerInterface) LookupTokenIdentity(chainID uint64, address commo } // LookupTokenIdentity indicates an expected call of LookupTokenIdentity. -func (mr *MockManagerInterfaceMockRecorder) LookupTokenIdentity(chainID, address, native interface{}) *gomock.Call { +func (mr *MockManagerInterfaceMockRecorder) LookupTokenIdentity(chainID, address, native any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LookupTokenIdentity", reflect.TypeOf((*MockManagerInterface)(nil).LookupTokenIdentity), chainID, address, native) } diff --git a/services/wallet/token/token_test.go b/services/wallet/token/token_test.go index b594206be..51617d670 100644 --- a/services/wallet/token/token_test.go +++ b/services/wallet/token/token_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/event" diff --git a/services/wallet/transfer/commands_sequential_test.go b/services/wallet/transfer/commands_sequential_test.go index 43210092c..3c1a333b6 100644 --- a/services/wallet/transfer/commands_sequential_test.go +++ b/services/wallet/transfer/commands_sequential_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/pkg/errors" "github.com/stretchr/testify/mock" + "go.uber.org/mock/gomock" "golang.org/x/exp/slices" // since 1.21, this is in the standard library "github.com/stretchr/testify/require" diff --git a/services/wallet/transfer/downloader_test.go b/services/wallet/transfer/downloader_test.go index c865e5601..1ee16af4f 100644 --- a/services/wallet/transfer/downloader_test.go +++ b/services/wallet/transfer/downloader_test.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" mock_client "github.com/status-im/status-go/rpc/chain/mock/client" walletCommon "github.com/status-im/status-go/services/wallet/common" diff --git a/services/wallet/transfer/transaction_manager_multitransaction_test.go b/services/wallet/transfer/transaction_manager_multitransaction_test.go index fdd789426..23089c4dd 100644 --- a/services/wallet/transfer/transaction_manager_multitransaction_test.go +++ b/services/wallet/transfer/transaction_manager_multitransaction_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" diff --git a/services/wallet/transfer/transaction_manager_test.go b/services/wallet/transfer/transaction_manager_test.go index 11e7f9e29..b3eb42ea6 100644 --- a/services/wallet/transfer/transaction_manager_test.go +++ b/services/wallet/transfer/transaction_manager_test.go @@ -10,8 +10,8 @@ import ( "reflect" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/status-im/status-go/eth-node/types" diff --git a/services/web3provider/api_test.go b/services/web3provider/api_test.go index 692e358fb..1332aca66 100644 --- a/services/web3provider/api_test.go +++ b/services/web3provider/api_test.go @@ -5,8 +5,8 @@ import ( "encoding/json" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/status-im/status-go/account" "github.com/status-im/status-go/appdatabase" diff --git a/transactions/fake/mock.go b/transactions/fake/mock.go index 7ccd5d6e1..8362e9886 100644 --- a/transactions/fake/mock.go +++ b/transactions/fake/mock.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: transactions/fake/txservice.go +// +// Generated by this command: +// +// mockgen -package=fake -destination=transactions/fake/mock.go -source=transactions/fake/txservice.go +// // Package fake is a generated GoMock package. package fake @@ -8,52 +13,36 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" - common "github.com/ethereum/go-ethereum/common" hexutil "github.com/ethereum/go-ethereum/common/hexutil" rpc "github.com/ethereum/go-ethereum/rpc" + gomock "go.uber.org/mock/gomock" ) -// MockPublicTransactionPoolAPI is a mock of PublicTransactionPoolAPI interface +// MockPublicTransactionPoolAPI is a mock of PublicTransactionPoolAPI interface. type MockPublicTransactionPoolAPI struct { ctrl *gomock.Controller recorder *MockPublicTransactionPoolAPIMockRecorder } -// MockPublicTransactionPoolAPIMockRecorder is the mock recorder for MockPublicTransactionPoolAPI +// MockPublicTransactionPoolAPIMockRecorder is the mock recorder for MockPublicTransactionPoolAPI. type MockPublicTransactionPoolAPIMockRecorder struct { mock *MockPublicTransactionPoolAPI } -// NewMockPublicTransactionPoolAPI creates a new mock instance +// NewMockPublicTransactionPoolAPI creates a new mock instance. func NewMockPublicTransactionPoolAPI(ctrl *gomock.Controller) *MockPublicTransactionPoolAPI { mock := &MockPublicTransactionPoolAPI{ctrl: ctrl} mock.recorder = &MockPublicTransactionPoolAPIMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockPublicTransactionPoolAPI) EXPECT() *MockPublicTransactionPoolAPIMockRecorder { return m.recorder } -// GasPrice mocks base method -func (m *MockPublicTransactionPoolAPI) GasPrice(ctx context.Context) (*hexutil.Big, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GasPrice", ctx) - ret0, _ := ret[0].(*hexutil.Big) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GasPrice indicates an expected call of GasPrice -func (mr *MockPublicTransactionPoolAPIMockRecorder) GasPrice(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasPrice", reflect.TypeOf((*MockPublicTransactionPoolAPI)(nil).GasPrice), ctx) -} - -// EstimateGas mocks base method +// EstimateGas mocks base method. func (m *MockPublicTransactionPoolAPI) EstimateGas(ctx context.Context, args CallArgs) (hexutil.Uint64, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EstimateGas", ctx, args) @@ -62,13 +51,28 @@ func (m *MockPublicTransactionPoolAPI) EstimateGas(ctx context.Context, args Cal return ret0, ret1 } -// EstimateGas indicates an expected call of EstimateGas -func (mr *MockPublicTransactionPoolAPIMockRecorder) EstimateGas(ctx, args interface{}) *gomock.Call { +// EstimateGas indicates an expected call of EstimateGas. +func (mr *MockPublicTransactionPoolAPIMockRecorder) EstimateGas(ctx, args any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EstimateGas", reflect.TypeOf((*MockPublicTransactionPoolAPI)(nil).EstimateGas), ctx, args) } -// GetTransactionCount mocks base method +// GasPrice mocks base method. +func (m *MockPublicTransactionPoolAPI) GasPrice(ctx context.Context) (*hexutil.Big, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GasPrice", ctx) + ret0, _ := ret[0].(*hexutil.Big) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GasPrice indicates an expected call of GasPrice. +func (mr *MockPublicTransactionPoolAPIMockRecorder) GasPrice(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GasPrice", reflect.TypeOf((*MockPublicTransactionPoolAPI)(nil).GasPrice), ctx) +} + +// GetTransactionCount mocks base method. func (m *MockPublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (*hexutil.Uint64, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetTransactionCount", ctx, address, blockNr) @@ -77,13 +81,13 @@ func (m *MockPublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, return ret0, ret1 } -// GetTransactionCount indicates an expected call of GetTransactionCount -func (mr *MockPublicTransactionPoolAPIMockRecorder) GetTransactionCount(ctx, address, blockNr interface{}) *gomock.Call { +// GetTransactionCount indicates an expected call of GetTransactionCount. +func (mr *MockPublicTransactionPoolAPIMockRecorder) GetTransactionCount(ctx, address, blockNr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransactionCount", reflect.TypeOf((*MockPublicTransactionPoolAPI)(nil).GetTransactionCount), ctx, address, blockNr) } -// SendRawTransaction mocks base method +// SendRawTransaction mocks base method. func (m *MockPublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendRawTransaction", ctx, encodedTx) @@ -92,8 +96,8 @@ func (m *MockPublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, e return ret0, ret1 } -// SendRawTransaction indicates an expected call of SendRawTransaction -func (mr *MockPublicTransactionPoolAPIMockRecorder) SendRawTransaction(ctx, encodedTx interface{}) *gomock.Call { +// SendRawTransaction indicates an expected call of SendRawTransaction. +func (mr *MockPublicTransactionPoolAPIMockRecorder) SendRawTransaction(ctx, encodedTx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendRawTransaction", reflect.TypeOf((*MockPublicTransactionPoolAPI)(nil).SendRawTransaction), ctx, encodedTx) } diff --git a/transactions/fake/txservice.go b/transactions/fake/txservice.go index 12c257b34..14ff17966 100644 --- a/transactions/fake/txservice.go +++ b/transactions/fake/txservice.go @@ -3,7 +3,7 @@ package fake import ( "context" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" diff --git a/transactions/mock_transactor/transactor.go b/transactions/mock_transactor/transactor.go index 25cacfeed..548d156e8 100644 --- a/transactions/mock_transactor/transactor.go +++ b/transactions/mock_transactor/transactor.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: transactions/transactor.go +// +// Generated by this command: +// +// mockgen -package=mock_transactor -destination=transactions/mock_transactor/transactor.go -source=transactions/transactor.go +// // Package mock_transactor is a generated GoMock package. package mock_transactor @@ -8,8 +13,6 @@ import ( big "math/big" reflect "reflect" - gomock "github.com/golang/mock/gomock" - common "github.com/ethereum/go-ethereum/common" types "github.com/ethereum/go-ethereum/core/types" account "github.com/status-im/status-go/account" @@ -18,6 +21,7 @@ import ( rpc "github.com/status-im/status-go/rpc" common0 "github.com/status-im/status-go/services/wallet/common" transactions "github.com/status-im/status-go/transactions" + gomock "go.uber.org/mock/gomock" ) // MockTransactorIface is a mock of TransactorIface interface. @@ -53,7 +57,7 @@ func (m *MockTransactorIface) AddSignatureToTransaction(chainID uint64, tx *type } // AddSignatureToTransaction indicates an expected call of AddSignatureToTransaction. -func (mr *MockTransactorIfaceMockRecorder) AddSignatureToTransaction(chainID, tx, sig interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) AddSignatureToTransaction(chainID, tx, sig any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSignatureToTransaction", reflect.TypeOf((*MockTransactorIface)(nil).AddSignatureToTransaction), chainID, tx, sig) } @@ -68,7 +72,7 @@ func (m *MockTransactorIface) BuildTransactionWithSignature(chainID uint64, args } // BuildTransactionWithSignature indicates an expected call of BuildTransactionWithSignature. -func (mr *MockTransactorIfaceMockRecorder) BuildTransactionWithSignature(chainID, args, sig interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) BuildTransactionWithSignature(chainID, args, sig any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildTransactionWithSignature", reflect.TypeOf((*MockTransactorIface)(nil).BuildTransactionWithSignature), chainID, args, sig) } @@ -83,7 +87,7 @@ func (m *MockTransactorIface) EstimateGas(network *params.Network, from, to comm } // EstimateGas indicates an expected call of EstimateGas. -func (mr *MockTransactorIfaceMockRecorder) EstimateGas(network, from, to, value, input interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) EstimateGas(network, from, to, value, input any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EstimateGas", reflect.TypeOf((*MockTransactorIface)(nil).EstimateGas), network, from, to, value, input) } @@ -98,7 +102,7 @@ func (m *MockTransactorIface) NextNonce(rpcClient rpc.ClientInterface, chainID u } // NextNonce indicates an expected call of NextNonce. -func (mr *MockTransactorIfaceMockRecorder) NextNonce(rpcClient, chainID, from interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) NextNonce(rpcClient, chainID, from any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NextNonce", reflect.TypeOf((*MockTransactorIface)(nil).NextNonce), rpcClient, chainID, from) } @@ -112,7 +116,7 @@ func (m *MockTransactorIface) SendRawTransaction(chainID uint64, rawTx string) e } // SendRawTransaction indicates an expected call of SendRawTransaction. -func (mr *MockTransactorIfaceMockRecorder) SendRawTransaction(chainID, rawTx interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) SendRawTransaction(chainID, rawTx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendRawTransaction", reflect.TypeOf((*MockTransactorIface)(nil).SendRawTransaction), chainID, rawTx) } @@ -128,7 +132,7 @@ func (m *MockTransactorIface) SendTransaction(sendArgs transactions.SendTxArgs, } // SendTransaction indicates an expected call of SendTransaction. -func (mr *MockTransactorIfaceMockRecorder) SendTransaction(sendArgs, verifiedAccount, lastUsedNonce interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) SendTransaction(sendArgs, verifiedAccount, lastUsedNonce any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendTransaction", reflect.TypeOf((*MockTransactorIface)(nil).SendTransaction), sendArgs, verifiedAccount, lastUsedNonce) } @@ -144,7 +148,7 @@ func (m *MockTransactorIface) SendTransactionWithChainID(chainID uint64, sendArg } // SendTransactionWithChainID indicates an expected call of SendTransactionWithChainID. -func (mr *MockTransactorIfaceMockRecorder) SendTransactionWithChainID(chainID, sendArgs, lastUsedNonce, verifiedAccount interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) SendTransactionWithChainID(chainID, sendArgs, lastUsedNonce, verifiedAccount any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendTransactionWithChainID", reflect.TypeOf((*MockTransactorIface)(nil).SendTransactionWithChainID), chainID, sendArgs, lastUsedNonce, verifiedAccount) } @@ -159,7 +163,7 @@ func (m *MockTransactorIface) SendTransactionWithSignature(from common.Address, } // SendTransactionWithSignature indicates an expected call of SendTransactionWithSignature. -func (mr *MockTransactorIfaceMockRecorder) SendTransactionWithSignature(from, symbol, multiTransactionID, tx interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) SendTransactionWithSignature(from, symbol, multiTransactionID, tx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendTransactionWithSignature", reflect.TypeOf((*MockTransactorIface)(nil).SendTransactionWithSignature), from, symbol, multiTransactionID, tx) } @@ -173,7 +177,7 @@ func (m *MockTransactorIface) StoreAndTrackPendingTx(from common.Address, symbol } // StoreAndTrackPendingTx indicates an expected call of StoreAndTrackPendingTx. -func (mr *MockTransactorIfaceMockRecorder) StoreAndTrackPendingTx(from, symbol, chainID, multiTransactionID, tx interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) StoreAndTrackPendingTx(from, symbol, chainID, multiTransactionID, tx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreAndTrackPendingTx", reflect.TypeOf((*MockTransactorIface)(nil).StoreAndTrackPendingTx), from, symbol, chainID, multiTransactionID, tx) } @@ -189,7 +193,7 @@ func (m *MockTransactorIface) ValidateAndBuildTransaction(chainID uint64, sendAr } // ValidateAndBuildTransaction indicates an expected call of ValidateAndBuildTransaction. -func (mr *MockTransactorIfaceMockRecorder) ValidateAndBuildTransaction(chainID, sendArgs, lastUsedNonce interface{}) *gomock.Call { +func (mr *MockTransactorIfaceMockRecorder) ValidateAndBuildTransaction(chainID, sendArgs, lastUsedNonce any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateAndBuildTransaction", reflect.TypeOf((*MockTransactorIface)(nil).ValidateAndBuildTransaction), chainID, sendArgs, lastUsedNonce) } diff --git a/transactions/pendingtxtracker_test.go b/transactions/pendingtxtracker_test.go index 638b2f23f..7d1002994 100644 --- a/transactions/pendingtxtracker_test.go +++ b/transactions/pendingtxtracker_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" eth "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" diff --git a/transactions/transactor_test.go b/transactions/transactor_test.go index 8ff005713..220399809 100644 --- a/transactions/transactor_test.go +++ b/transactions/transactor_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" diff --git a/vendor/github.com/golang/mock/AUTHORS b/vendor/github.com/golang/mock/AUTHORS deleted file mode 100644 index 660b8ccc8..000000000 --- a/vendor/github.com/golang/mock/AUTHORS +++ /dev/null @@ -1,12 +0,0 @@ -# This is the official list of GoMock authors for copyright purposes. -# This file is distinct from the CONTRIBUTORS files. -# See the latter for an explanation. - -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# Please keep the list sorted. - -Alex Reece -Google Inc. diff --git a/vendor/github.com/golang/mock/CONTRIBUTORS b/vendor/github.com/golang/mock/CONTRIBUTORS deleted file mode 100644 index def849cab..000000000 --- a/vendor/github.com/golang/mock/CONTRIBUTORS +++ /dev/null @@ -1,37 +0,0 @@ -# This is the official list of people who can contribute (and typically -# have contributed) code to the gomock repository. -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, Google employees are listed here -# but not in AUTHORS, because Google holds the copyright. -# -# The submission process automatically checks to make sure -# that people submitting code are listed in this file (by email address). -# -# Names should be added to this file only after verifying that -# the individual or the individual's organization has agreed to -# the appropriate Contributor License Agreement, found here: -# -# http://code.google.com/legal/individual-cla-v1.0.html -# http://code.google.com/legal/corporate-cla-v1.0.html -# -# The agreement for individuals can be filled out on the web. -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file, depending on whether the -# individual or corporate CLA was used. - -# Names should be added to this file like so: -# Name -# -# An entry with two email addresses specifies that the -# first address should be used in the submit logs and -# that the second address should be recognized as the -# same person when interacting with Rietveld. - -# Please keep the list sorted. - -Aaron Jacobs -Alex Reece -David Symonds -Ryan Barrett diff --git a/vendor/github.com/golang/mock/LICENSE b/vendor/github.com/golang/mock/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/golang/mock/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/golang/mock/gomock/call.go b/vendor/github.com/golang/mock/gomock/call.go deleted file mode 100644 index 13c9f44b1..000000000 --- a/vendor/github.com/golang/mock/gomock/call.go +++ /dev/null @@ -1,445 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomock - -import ( - "fmt" - "reflect" - "strconv" - "strings" -) - -// Call represents an expected call to a mock. -type Call struct { - t TestHelper // for triggering test failures on invalid call setup - - receiver interface{} // the receiver of the method call - method string // the name of the method - methodType reflect.Type // the type of the method - args []Matcher // the args - origin string // file and line number of call setup - - preReqs []*Call // prerequisite calls - - // Expectations - minCalls, maxCalls int - - numCalls int // actual number made - - // actions are called when this Call is called. Each action gets the args and - // can set the return values by returning a non-nil slice. Actions run in the - // order they are created. - actions []func([]interface{}) []interface{} -} - -// newCall creates a *Call. It requires the method type in order to support -// unexported methods. -func newCall(t TestHelper, receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { - t.Helper() - - // TODO: check arity, types. - mArgs := make([]Matcher, len(args)) - for i, arg := range args { - if m, ok := arg.(Matcher); ok { - mArgs[i] = m - } else if arg == nil { - // Handle nil specially so that passing a nil interface value - // will match the typed nils of concrete args. - mArgs[i] = Nil() - } else { - mArgs[i] = Eq(arg) - } - } - - // callerInfo's skip should be updated if the number of calls between the user's test - // and this line changes, i.e. this code is wrapped in another anonymous function. - // 0 is us, 1 is RecordCallWithMethodType(), 2 is the generated recorder, and 3 is the user's test. - origin := callerInfo(3) - actions := []func([]interface{}) []interface{}{func([]interface{}) []interface{} { - // Synthesize the zero value for each of the return args' types. - rets := make([]interface{}, methodType.NumOut()) - for i := 0; i < methodType.NumOut(); i++ { - rets[i] = reflect.Zero(methodType.Out(i)).Interface() - } - return rets - }} - return &Call{t: t, receiver: receiver, method: method, methodType: methodType, - args: mArgs, origin: origin, minCalls: 1, maxCalls: 1, actions: actions} -} - -// AnyTimes allows the expectation to be called 0 or more times -func (c *Call) AnyTimes() *Call { - c.minCalls, c.maxCalls = 0, 1e8 // close enough to infinity - return c -} - -// MinTimes requires the call to occur at least n times. If AnyTimes or MaxTimes have not been called or if MaxTimes -// was previously called with 1, MinTimes also sets the maximum number of calls to infinity. -func (c *Call) MinTimes(n int) *Call { - c.minCalls = n - if c.maxCalls == 1 { - c.maxCalls = 1e8 - } - return c -} - -// MaxTimes limits the number of calls to n times. If AnyTimes or MinTimes have not been called or if MinTimes was -// previously called with 1, MaxTimes also sets the minimum number of calls to 0. -func (c *Call) MaxTimes(n int) *Call { - c.maxCalls = n - if c.minCalls == 1 { - c.minCalls = 0 - } - return c -} - -// DoAndReturn declares the action to run when the call is matched. -// The return values from this function are returned by the mocked function. -// It takes an interface{} argument to support n-arity functions. -func (c *Call) DoAndReturn(f interface{}) *Call { - // TODO: Check arity and types here, rather than dying badly elsewhere. - v := reflect.ValueOf(f) - - c.addAction(func(args []interface{}) []interface{} { - c.t.Helper() - vArgs := make([]reflect.Value, len(args)) - ft := v.Type() - if c.methodType.NumIn() != ft.NumIn() { - c.t.Fatalf("wrong number of arguments in DoAndReturn func for %T.%v: got %d, want %d [%s]", - c.receiver, c.method, ft.NumIn(), c.methodType.NumIn(), c.origin) - return nil - } - for i := 0; i < len(args); i++ { - if args[i] != nil { - vArgs[i] = reflect.ValueOf(args[i]) - } else { - // Use the zero value for the arg. - vArgs[i] = reflect.Zero(ft.In(i)) - } - } - vRets := v.Call(vArgs) - rets := make([]interface{}, len(vRets)) - for i, ret := range vRets { - rets[i] = ret.Interface() - } - return rets - }) - return c -} - -// Do declares the action to run when the call is matched. The function's -// return values are ignored to retain backward compatibility. To use the -// return values call DoAndReturn. -// It takes an interface{} argument to support n-arity functions. -func (c *Call) Do(f interface{}) *Call { - // TODO: Check arity and types here, rather than dying badly elsewhere. - v := reflect.ValueOf(f) - - c.addAction(func(args []interface{}) []interface{} { - c.t.Helper() - if c.methodType.NumIn() != v.Type().NumIn() { - c.t.Fatalf("wrong number of arguments in Do func for %T.%v: got %d, want %d [%s]", - c.receiver, c.method, v.Type().NumIn(), c.methodType.NumIn(), c.origin) - return nil - } - vArgs := make([]reflect.Value, len(args)) - ft := v.Type() - for i := 0; i < len(args); i++ { - if args[i] != nil { - vArgs[i] = reflect.ValueOf(args[i]) - } else { - // Use the zero value for the arg. - vArgs[i] = reflect.Zero(ft.In(i)) - } - } - v.Call(vArgs) - return nil - }) - return c -} - -// Return declares the values to be returned by the mocked function call. -func (c *Call) Return(rets ...interface{}) *Call { - c.t.Helper() - - mt := c.methodType - if len(rets) != mt.NumOut() { - c.t.Fatalf("wrong number of arguments to Return for %T.%v: got %d, want %d [%s]", - c.receiver, c.method, len(rets), mt.NumOut(), c.origin) - } - for i, ret := range rets { - if got, want := reflect.TypeOf(ret), mt.Out(i); got == want { - // Identical types; nothing to do. - } else if got == nil { - // Nil needs special handling. - switch want.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - // ok - default: - c.t.Fatalf("argument %d to Return for %T.%v is nil, but %v is not nillable [%s]", - i, c.receiver, c.method, want, c.origin) - } - } else if got.AssignableTo(want) { - // Assignable type relation. Make the assignment now so that the generated code - // can return the values with a type assertion. - v := reflect.New(want).Elem() - v.Set(reflect.ValueOf(ret)) - rets[i] = v.Interface() - } else { - c.t.Fatalf("wrong type of argument %d to Return for %T.%v: %v is not assignable to %v [%s]", - i, c.receiver, c.method, got, want, c.origin) - } - } - - c.addAction(func([]interface{}) []interface{} { - return rets - }) - - return c -} - -// Times declares the exact number of times a function call is expected to be executed. -func (c *Call) Times(n int) *Call { - c.minCalls, c.maxCalls = n, n - return c -} - -// SetArg declares an action that will set the nth argument's value, -// indirected through a pointer. Or, in the case of a slice, SetArg -// will copy value's elements into the nth argument. -func (c *Call) SetArg(n int, value interface{}) *Call { - c.t.Helper() - - mt := c.methodType - // TODO: This will break on variadic methods. - // We will need to check those at invocation time. - if n < 0 || n >= mt.NumIn() { - c.t.Fatalf("SetArg(%d, ...) called for a method with %d args [%s]", - n, mt.NumIn(), c.origin) - } - // Permit setting argument through an interface. - // In the interface case, we don't (nay, can't) check the type here. - at := mt.In(n) - switch at.Kind() { - case reflect.Ptr: - dt := at.Elem() - if vt := reflect.TypeOf(value); !vt.AssignableTo(dt) { - c.t.Fatalf("SetArg(%d, ...) argument is a %v, not assignable to %v [%s]", - n, vt, dt, c.origin) - } - case reflect.Interface: - // nothing to do - case reflect.Slice: - // nothing to do - default: - c.t.Fatalf("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice type %v [%s]", - n, at, c.origin) - } - - c.addAction(func(args []interface{}) []interface{} { - v := reflect.ValueOf(value) - switch reflect.TypeOf(args[n]).Kind() { - case reflect.Slice: - setSlice(args[n], v) - default: - reflect.ValueOf(args[n]).Elem().Set(v) - } - return nil - }) - return c -} - -// isPreReq returns true if other is a direct or indirect prerequisite to c. -func (c *Call) isPreReq(other *Call) bool { - for _, preReq := range c.preReqs { - if other == preReq || preReq.isPreReq(other) { - return true - } - } - return false -} - -// After declares that the call may only match after preReq has been exhausted. -func (c *Call) After(preReq *Call) *Call { - c.t.Helper() - - if c == preReq { - c.t.Fatalf("A call isn't allowed to be its own prerequisite") - } - if preReq.isPreReq(c) { - c.t.Fatalf("Loop in call order: %v is a prerequisite to %v (possibly indirectly).", c, preReq) - } - - c.preReqs = append(c.preReqs, preReq) - return c -} - -// Returns true if the minimum number of calls have been made. -func (c *Call) satisfied() bool { - return c.numCalls >= c.minCalls -} - -// Returns true if the maximum number of calls have been made. -func (c *Call) exhausted() bool { - return c.numCalls >= c.maxCalls -} - -func (c *Call) String() string { - args := make([]string, len(c.args)) - for i, arg := range c.args { - args[i] = arg.String() - } - arguments := strings.Join(args, ", ") - return fmt.Sprintf("%T.%v(%s) %s", c.receiver, c.method, arguments, c.origin) -} - -// Tests if the given call matches the expected call. -// If yes, returns nil. If no, returns error with message explaining why it does not match. -func (c *Call) matches(args []interface{}) error { - if !c.methodType.IsVariadic() { - if len(args) != len(c.args) { - return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d", - c.origin, len(args), len(c.args)) - } - - for i, m := range c.args { - if !m.Matches(args[i]) { - return fmt.Errorf( - "expected call at %s doesn't match the argument at index %d.\nGot: %v\nWant: %v", - c.origin, i, formatGottenArg(m, args[i]), m, - ) - } - } - } else { - if len(c.args) < c.methodType.NumIn()-1 { - return fmt.Errorf("expected call at %s has the wrong number of matchers. Got: %d, want: %d", - c.origin, len(c.args), c.methodType.NumIn()-1) - } - if len(c.args) != c.methodType.NumIn() && len(args) != len(c.args) { - return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d", - c.origin, len(args), len(c.args)) - } - if len(args) < len(c.args)-1 { - return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: greater than or equal to %d", - c.origin, len(args), len(c.args)-1) - } - - for i, m := range c.args { - if i < c.methodType.NumIn()-1 { - // Non-variadic args - if !m.Matches(args[i]) { - return fmt.Errorf("expected call at %s doesn't match the argument at index %s.\nGot: %v\nWant: %v", - c.origin, strconv.Itoa(i), formatGottenArg(m, args[i]), m) - } - continue - } - // The last arg has a possibility of a variadic argument, so let it branch - - // sample: Foo(a int, b int, c ...int) - if i < len(c.args) && i < len(args) { - if m.Matches(args[i]) { - // Got Foo(a, b, c) want Foo(matcherA, matcherB, gomock.Any()) - // Got Foo(a, b, c) want Foo(matcherA, matcherB, someSliceMatcher) - // Got Foo(a, b, c) want Foo(matcherA, matcherB, matcherC) - // Got Foo(a, b) want Foo(matcherA, matcherB) - // Got Foo(a, b, c, d) want Foo(matcherA, matcherB, matcherC, matcherD) - continue - } - } - - // The number of actual args don't match the number of matchers, - // or the last matcher is a slice and the last arg is not. - // If this function still matches it is because the last matcher - // matches all the remaining arguments or the lack of any. - // Convert the remaining arguments, if any, into a slice of the - // expected type. - vArgsType := c.methodType.In(c.methodType.NumIn() - 1) - vArgs := reflect.MakeSlice(vArgsType, 0, len(args)-i) - for _, arg := range args[i:] { - vArgs = reflect.Append(vArgs, reflect.ValueOf(arg)) - } - if m.Matches(vArgs.Interface()) { - // Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, gomock.Any()) - // Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, someSliceMatcher) - // Got Foo(a, b) want Foo(matcherA, matcherB, gomock.Any()) - // Got Foo(a, b) want Foo(matcherA, matcherB, someEmptySliceMatcher) - break - } - // Wrong number of matchers or not match. Fail. - // Got Foo(a, b) want Foo(matcherA, matcherB, matcherC, matcherD) - // Got Foo(a, b, c) want Foo(matcherA, matcherB, matcherC, matcherD) - // Got Foo(a, b, c, d) want Foo(matcherA, matcherB, matcherC, matcherD, matcherE) - // Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, matcherC, matcherD) - // Got Foo(a, b, c) want Foo(matcherA, matcherB) - - return fmt.Errorf("expected call at %s doesn't match the argument at index %s.\nGot: %v\nWant: %v", - c.origin, strconv.Itoa(i), formatGottenArg(m, args[i:]), c.args[i]) - } - } - - // Check that all prerequisite calls have been satisfied. - for _, preReqCall := range c.preReqs { - if !preReqCall.satisfied() { - return fmt.Errorf("expected call at %s doesn't have a prerequisite call satisfied:\n%v\nshould be called before:\n%v", - c.origin, preReqCall, c) - } - } - - // Check that the call is not exhausted. - if c.exhausted() { - return fmt.Errorf("expected call at %s has already been called the max number of times", c.origin) - } - - return nil -} - -// dropPrereqs tells the expected Call to not re-check prerequisite calls any -// longer, and to return its current set. -func (c *Call) dropPrereqs() (preReqs []*Call) { - preReqs = c.preReqs - c.preReqs = nil - return -} - -func (c *Call) call() []func([]interface{}) []interface{} { - c.numCalls++ - return c.actions -} - -// InOrder declares that the given calls should occur in order. -func InOrder(calls ...*Call) { - for i := 1; i < len(calls); i++ { - calls[i].After(calls[i-1]) - } -} - -func setSlice(arg interface{}, v reflect.Value) { - va := reflect.ValueOf(arg) - for i := 0; i < v.Len(); i++ { - va.Index(i).Set(v.Index(i)) - } -} - -func (c *Call) addAction(action func([]interface{}) []interface{}) { - c.actions = append(c.actions, action) -} - -func formatGottenArg(m Matcher, arg interface{}) string { - got := fmt.Sprintf("%v (%T)", arg, arg) - if gs, ok := m.(GotFormatter); ok { - got = gs.Got(arg) - } - return got -} diff --git a/vendor/github.com/golang/mock/gomock/callset.go b/vendor/github.com/golang/mock/gomock/callset.go deleted file mode 100644 index 49dba787a..000000000 --- a/vendor/github.com/golang/mock/gomock/callset.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2011 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomock - -import ( - "bytes" - "errors" - "fmt" -) - -// callSet represents a set of expected calls, indexed by receiver and method -// name. -type callSet struct { - // Calls that are still expected. - expected map[callSetKey][]*Call - // Calls that have been exhausted. - exhausted map[callSetKey][]*Call -} - -// callSetKey is the key in the maps in callSet -type callSetKey struct { - receiver interface{} - fname string -} - -func newCallSet() *callSet { - return &callSet{make(map[callSetKey][]*Call), make(map[callSetKey][]*Call)} -} - -// Add adds a new expected call. -func (cs callSet) Add(call *Call) { - key := callSetKey{call.receiver, call.method} - m := cs.expected - if call.exhausted() { - m = cs.exhausted - } - m[key] = append(m[key], call) -} - -// Remove removes an expected call. -func (cs callSet) Remove(call *Call) { - key := callSetKey{call.receiver, call.method} - calls := cs.expected[key] - for i, c := range calls { - if c == call { - // maintain order for remaining calls - cs.expected[key] = append(calls[:i], calls[i+1:]...) - cs.exhausted[key] = append(cs.exhausted[key], call) - break - } - } -} - -// FindMatch searches for a matching call. Returns error with explanation message if no call matched. -func (cs callSet) FindMatch(receiver interface{}, method string, args []interface{}) (*Call, error) { - key := callSetKey{receiver, method} - - // Search through the expected calls. - expected := cs.expected[key] - var callsErrors bytes.Buffer - for _, call := range expected { - err := call.matches(args) - if err != nil { - _, _ = fmt.Fprintf(&callsErrors, "\n%v", err) - } else { - return call, nil - } - } - - // If we haven't found a match then search through the exhausted calls so we - // get useful error messages. - exhausted := cs.exhausted[key] - for _, call := range exhausted { - if err := call.matches(args); err != nil { - _, _ = fmt.Fprintf(&callsErrors, "\n%v", err) - continue - } - _, _ = fmt.Fprintf( - &callsErrors, "all expected calls for method %q have been exhausted", method, - ) - } - - if len(expected)+len(exhausted) == 0 { - _, _ = fmt.Fprintf(&callsErrors, "there are no expected calls of the method %q for that receiver", method) - } - - return nil, errors.New(callsErrors.String()) -} - -// Failures returns the calls that are not satisfied. -func (cs callSet) Failures() []*Call { - failures := make([]*Call, 0, len(cs.expected)) - for _, calls := range cs.expected { - for _, call := range calls { - if !call.satisfied() { - failures = append(failures, call) - } - } - } - return failures -} diff --git a/vendor/github.com/golang/mock/gomock/controller.go b/vendor/github.com/golang/mock/gomock/controller.go deleted file mode 100644 index f054200d5..000000000 --- a/vendor/github.com/golang/mock/gomock/controller.go +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package gomock is a mock framework for Go. -// -// Standard usage: -// (1) Define an interface that you wish to mock. -// type MyInterface interface { -// SomeMethod(x int64, y string) -// } -// (2) Use mockgen to generate a mock from the interface. -// (3) Use the mock in a test: -// func TestMyThing(t *testing.T) { -// mockCtrl := gomock.NewController(t) -// defer mockCtrl.Finish() -// -// mockObj := something.NewMockMyInterface(mockCtrl) -// mockObj.EXPECT().SomeMethod(4, "blah") -// // pass mockObj to a real object and play with it. -// } -// -// By default, expected calls are not enforced to run in any particular order. -// Call order dependency can be enforced by use of InOrder and/or Call.After. -// Call.After can create more varied call order dependencies, but InOrder is -// often more convenient. -// -// The following examples create equivalent call order dependencies. -// -// Example of using Call.After to chain expected call order: -// -// firstCall := mockObj.EXPECT().SomeMethod(1, "first") -// secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall) -// mockObj.EXPECT().SomeMethod(3, "third").After(secondCall) -// -// Example of using InOrder to declare expected call order: -// -// gomock.InOrder( -// mockObj.EXPECT().SomeMethod(1, "first"), -// mockObj.EXPECT().SomeMethod(2, "second"), -// mockObj.EXPECT().SomeMethod(3, "third"), -// ) -package gomock - -import ( - "context" - "fmt" - "reflect" - "runtime" - "sync" -) - -// A TestReporter is something that can be used to report test failures. It -// is satisfied by the standard library's *testing.T. -type TestReporter interface { - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) -} - -// TestHelper is a TestReporter that has the Helper method. It is satisfied -// by the standard library's *testing.T. -type TestHelper interface { - TestReporter - Helper() -} - -// cleanuper is used to check if TestHelper also has the `Cleanup` method. A -// common pattern is to pass in a `*testing.T` to -// `NewController(t TestReporter)`. In Go 1.14+, `*testing.T` has a cleanup -// method. This can be utilized to call `Finish()` so the caller of this library -// does not have to. -type cleanuper interface { - Cleanup(func()) -} - -// A Controller represents the top-level control of a mock ecosystem. It -// defines the scope and lifetime of mock objects, as well as their -// expectations. It is safe to call Controller's methods from multiple -// goroutines. Each test should create a new Controller and invoke Finish via -// defer. -// -// func TestFoo(t *testing.T) { -// ctrl := gomock.NewController(t) -// defer ctrl.Finish() -// // .. -// } -// -// func TestBar(t *testing.T) { -// t.Run("Sub-Test-1", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// t.Run("Sub-Test-2", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// }) -type Controller struct { - // T should only be called within a generated mock. It is not intended to - // be used in user code and may be changed in future versions. T is the - // TestReporter passed in when creating the Controller via NewController. - // If the TestReporter does not implement a TestHelper it will be wrapped - // with a nopTestHelper. - T TestHelper - mu sync.Mutex - expectedCalls *callSet - finished bool -} - -// NewController returns a new Controller. It is the preferred way to create a -// Controller. -// -// New in go1.14+, if you are passing a *testing.T into this function you no -// longer need to call ctrl.Finish() in your test methods. -func NewController(t TestReporter) *Controller { - h, ok := t.(TestHelper) - if !ok { - h = &nopTestHelper{t} - } - ctrl := &Controller{ - T: h, - expectedCalls: newCallSet(), - } - if c, ok := isCleanuper(ctrl.T); ok { - c.Cleanup(func() { - ctrl.T.Helper() - ctrl.finish(true, nil) - }) - } - - return ctrl -} - -type cancelReporter struct { - t TestHelper - cancel func() -} - -func (r *cancelReporter) Errorf(format string, args ...interface{}) { - r.t.Errorf(format, args...) -} -func (r *cancelReporter) Fatalf(format string, args ...interface{}) { - defer r.cancel() - r.t.Fatalf(format, args...) -} - -func (r *cancelReporter) Helper() { - r.t.Helper() -} - -// WithContext returns a new Controller and a Context, which is cancelled on any -// fatal failure. -func WithContext(ctx context.Context, t TestReporter) (*Controller, context.Context) { - h, ok := t.(TestHelper) - if !ok { - h = &nopTestHelper{t: t} - } - - ctx, cancel := context.WithCancel(ctx) - return NewController(&cancelReporter{t: h, cancel: cancel}), ctx -} - -type nopTestHelper struct { - t TestReporter -} - -func (h *nopTestHelper) Errorf(format string, args ...interface{}) { - h.t.Errorf(format, args...) -} -func (h *nopTestHelper) Fatalf(format string, args ...interface{}) { - h.t.Fatalf(format, args...) -} - -func (h nopTestHelper) Helper() {} - -// RecordCall is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ...interface{}) *Call { - ctrl.T.Helper() - - recv := reflect.ValueOf(receiver) - for i := 0; i < recv.Type().NumMethod(); i++ { - if recv.Type().Method(i).Name == method { - return ctrl.RecordCallWithMethodType(receiver, method, recv.Method(i).Type(), args...) - } - } - ctrl.T.Fatalf("gomock: failed finding method %s on %T", method, receiver) - panic("unreachable") -} - -// RecordCallWithMethodType is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { - ctrl.T.Helper() - - call := newCall(ctrl.T, receiver, method, methodType, args...) - - ctrl.mu.Lock() - defer ctrl.mu.Unlock() - ctrl.expectedCalls.Add(call) - - return call -} - -// Call is called by a mock. It should not be called by user code. -func (ctrl *Controller) Call(receiver interface{}, method string, args ...interface{}) []interface{} { - ctrl.T.Helper() - - // Nest this code so we can use defer to make sure the lock is released. - actions := func() []func([]interface{}) []interface{} { - ctrl.T.Helper() - ctrl.mu.Lock() - defer ctrl.mu.Unlock() - - expected, err := ctrl.expectedCalls.FindMatch(receiver, method, args) - if err != nil { - // callerInfo's skip should be updated if the number of calls between the user's test - // and this line changes, i.e. this code is wrapped in another anonymous function. - // 0 is us, 1 is controller.Call(), 2 is the generated mock, and 3 is the user's test. - origin := callerInfo(3) - ctrl.T.Fatalf("Unexpected call to %T.%v(%v) at %s because: %s", receiver, method, args, origin, err) - } - - // Two things happen here: - // * the matching call no longer needs to check prerequite calls, - // * and the prerequite calls are no longer expected, so remove them. - preReqCalls := expected.dropPrereqs() - for _, preReqCall := range preReqCalls { - ctrl.expectedCalls.Remove(preReqCall) - } - - actions := expected.call() - if expected.exhausted() { - ctrl.expectedCalls.Remove(expected) - } - return actions - }() - - var rets []interface{} - for _, action := range actions { - if r := action(args); r != nil { - rets = r - } - } - - return rets -} - -// Finish checks to see if all the methods that were expected to be called -// were called. It should be invoked for each Controller. It is not idempotent -// and therefore can only be invoked once. -// -// New in go1.14+, if you are passing a *testing.T into NewController function you no -// longer need to call ctrl.Finish() in your test methods. -func (ctrl *Controller) Finish() { - // If we're currently panicking, probably because this is a deferred call. - // This must be recovered in the deferred function. - err := recover() - ctrl.finish(false, err) -} - -func (ctrl *Controller) finish(cleanup bool, panicErr interface{}) { - ctrl.T.Helper() - - ctrl.mu.Lock() - defer ctrl.mu.Unlock() - - if ctrl.finished { - if _, ok := isCleanuper(ctrl.T); !ok { - ctrl.T.Fatalf("Controller.Finish was called more than once. It has to be called exactly once.") - } - return - } - ctrl.finished = true - - // Short-circuit, pass through the panic. - if panicErr != nil { - panic(panicErr) - } - - // Check that all remaining expected calls are satisfied. - failures := ctrl.expectedCalls.Failures() - for _, call := range failures { - ctrl.T.Errorf("missing call(s) to %v", call) - } - if len(failures) != 0 { - if !cleanup { - ctrl.T.Fatalf("aborting test due to missing call(s)") - return - } - ctrl.T.Errorf("aborting test due to missing call(s)") - } -} - -// callerInfo returns the file:line of the call site. skip is the number -// of stack frames to skip when reporting. 0 is callerInfo's call site. -func callerInfo(skip int) string { - if _, file, line, ok := runtime.Caller(skip + 1); ok { - return fmt.Sprintf("%s:%d", file, line) - } - return "unknown file" -} - -// isCleanuper checks it if t's base TestReporter has a Cleanup method. -func isCleanuper(t TestReporter) (cleanuper, bool) { - tr := unwrapTestReporter(t) - c, ok := tr.(cleanuper) - return c, ok -} - -// unwrapTestReporter unwraps TestReporter to the base implementation. -func unwrapTestReporter(t TestReporter) TestReporter { - tr := t - switch nt := t.(type) { - case *cancelReporter: - tr = nt.t - if h, check := tr.(*nopTestHelper); check { - tr = h.t - } - case *nopTestHelper: - tr = nt.t - default: - // not wrapped - } - return tr -} diff --git a/vendor/github.com/golang/mock/gomock/matchers.go b/vendor/github.com/golang/mock/gomock/matchers.go deleted file mode 100644 index 2822fb2c8..000000000 --- a/vendor/github.com/golang/mock/gomock/matchers.go +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2010 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomock - -import ( - "fmt" - "reflect" - "strings" -) - -// A Matcher is a representation of a class of values. -// It is used to represent the valid or expected arguments to a mocked method. -type Matcher interface { - // Matches returns whether x is a match. - Matches(x interface{}) bool - - // String describes what the matcher matches. - String() string -} - -// WantFormatter modifies the given Matcher's String() method to the given -// Stringer. This allows for control on how the "Want" is formatted when -// printing . -func WantFormatter(s fmt.Stringer, m Matcher) Matcher { - type matcher interface { - Matches(x interface{}) bool - } - - return struct { - matcher - fmt.Stringer - }{ - matcher: m, - Stringer: s, - } -} - -// StringerFunc type is an adapter to allow the use of ordinary functions as -// a Stringer. If f is a function with the appropriate signature, -// StringerFunc(f) is a Stringer that calls f. -type StringerFunc func() string - -// String implements fmt.Stringer. -func (f StringerFunc) String() string { - return f() -} - -// GotFormatter is used to better print failure messages. If a matcher -// implements GotFormatter, it will use the result from Got when printing -// the failure message. -type GotFormatter interface { - // Got is invoked with the received value. The result is used when - // printing the failure message. - Got(got interface{}) string -} - -// GotFormatterFunc type is an adapter to allow the use of ordinary -// functions as a GotFormatter. If f is a function with the appropriate -// signature, GotFormatterFunc(f) is a GotFormatter that calls f. -type GotFormatterFunc func(got interface{}) string - -// Got implements GotFormatter. -func (f GotFormatterFunc) Got(got interface{}) string { - return f(got) -} - -// GotFormatterAdapter attaches a GotFormatter to a Matcher. -func GotFormatterAdapter(s GotFormatter, m Matcher) Matcher { - return struct { - GotFormatter - Matcher - }{ - GotFormatter: s, - Matcher: m, - } -} - -type anyMatcher struct{} - -func (anyMatcher) Matches(interface{}) bool { - return true -} - -func (anyMatcher) String() string { - return "is anything" -} - -type eqMatcher struct { - x interface{} -} - -func (e eqMatcher) Matches(x interface{}) bool { - // In case, some value is nil - if e.x == nil || x == nil { - return reflect.DeepEqual(e.x, x) - } - - // Check if types assignable and convert them to common type - x1Val := reflect.ValueOf(e.x) - x2Val := reflect.ValueOf(x) - - if x1Val.Type().AssignableTo(x2Val.Type()) { - x1ValConverted := x1Val.Convert(x2Val.Type()) - return reflect.DeepEqual(x1ValConverted.Interface(), x2Val.Interface()) - } - - return false -} - -func (e eqMatcher) String() string { - return fmt.Sprintf("is equal to %v (%T)", e.x, e.x) -} - -type nilMatcher struct{} - -func (nilMatcher) Matches(x interface{}) bool { - if x == nil { - return true - } - - v := reflect.ValueOf(x) - switch v.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, - reflect.Ptr, reflect.Slice: - return v.IsNil() - } - - return false -} - -func (nilMatcher) String() string { - return "is nil" -} - -type notMatcher struct { - m Matcher -} - -func (n notMatcher) Matches(x interface{}) bool { - return !n.m.Matches(x) -} - -func (n notMatcher) String() string { - return "not(" + n.m.String() + ")" -} - -type assignableToTypeOfMatcher struct { - targetType reflect.Type -} - -func (m assignableToTypeOfMatcher) Matches(x interface{}) bool { - return reflect.TypeOf(x).AssignableTo(m.targetType) -} - -func (m assignableToTypeOfMatcher) String() string { - return "is assignable to " + m.targetType.Name() -} - -type allMatcher struct { - matchers []Matcher -} - -func (am allMatcher) Matches(x interface{}) bool { - for _, m := range am.matchers { - if !m.Matches(x) { - return false - } - } - return true -} - -func (am allMatcher) String() string { - ss := make([]string, 0, len(am.matchers)) - for _, matcher := range am.matchers { - ss = append(ss, matcher.String()) - } - return strings.Join(ss, "; ") -} - -type lenMatcher struct { - i int -} - -func (m lenMatcher) Matches(x interface{}) bool { - v := reflect.ValueOf(x) - switch v.Kind() { - case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == m.i - default: - return false - } -} - -func (m lenMatcher) String() string { - return fmt.Sprintf("has length %d", m.i) -} - -type inAnyOrderMatcher struct { - x interface{} -} - -func (m inAnyOrderMatcher) Matches(x interface{}) bool { - given, ok := m.prepareValue(x) - if !ok { - return false - } - wanted, ok := m.prepareValue(m.x) - if !ok { - return false - } - - if given.Len() != wanted.Len() { - return false - } - - usedFromGiven := make([]bool, given.Len()) - foundFromWanted := make([]bool, wanted.Len()) - for i := 0; i < wanted.Len(); i++ { - wantedMatcher := Eq(wanted.Index(i).Interface()) - for j := 0; j < given.Len(); j++ { - if usedFromGiven[j] { - continue - } - if wantedMatcher.Matches(given.Index(j).Interface()) { - foundFromWanted[i] = true - usedFromGiven[j] = true - break - } - } - } - - missingFromWanted := 0 - for _, found := range foundFromWanted { - if !found { - missingFromWanted++ - } - } - extraInGiven := 0 - for _, used := range usedFromGiven { - if !used { - extraInGiven++ - } - } - - return extraInGiven == 0 && missingFromWanted == 0 -} - -func (m inAnyOrderMatcher) prepareValue(x interface{}) (reflect.Value, bool) { - xValue := reflect.ValueOf(x) - switch xValue.Kind() { - case reflect.Slice, reflect.Array: - return xValue, true - default: - return reflect.Value{}, false - } -} - -func (m inAnyOrderMatcher) String() string { - return fmt.Sprintf("has the same elements as %v", m.x) -} - -// Constructors - -// All returns a composite Matcher that returns true if and only all of the -// matchers return true. -func All(ms ...Matcher) Matcher { return allMatcher{ms} } - -// Any returns a matcher that always matches. -func Any() Matcher { return anyMatcher{} } - -// Eq returns a matcher that matches on equality. -// -// Example usage: -// Eq(5).Matches(5) // returns true -// Eq(5).Matches(4) // returns false -func Eq(x interface{}) Matcher { return eqMatcher{x} } - -// Len returns a matcher that matches on length. This matcher returns false if -// is compared to a type that is not an array, chan, map, slice, or string. -func Len(i int) Matcher { - return lenMatcher{i} -} - -// Nil returns a matcher that matches if the received value is nil. -// -// Example usage: -// var x *bytes.Buffer -// Nil().Matches(x) // returns true -// x = &bytes.Buffer{} -// Nil().Matches(x) // returns false -func Nil() Matcher { return nilMatcher{} } - -// Not reverses the results of its given child matcher. -// -// Example usage: -// Not(Eq(5)).Matches(4) // returns true -// Not(Eq(5)).Matches(5) // returns false -func Not(x interface{}) Matcher { - if m, ok := x.(Matcher); ok { - return notMatcher{m} - } - return notMatcher{Eq(x)} -} - -// AssignableToTypeOf is a Matcher that matches if the parameter to the mock -// function is assignable to the type of the parameter to this function. -// -// Example usage: -// var s fmt.Stringer = &bytes.Buffer{} -// AssignableToTypeOf(s).Matches(time.Second) // returns true -// AssignableToTypeOf(s).Matches(99) // returns false -// -// var ctx = reflect.TypeOf((*context.Context)(nil)).Elem() -// AssignableToTypeOf(ctx).Matches(context.Background()) // returns true -func AssignableToTypeOf(x interface{}) Matcher { - if xt, ok := x.(reflect.Type); ok { - return assignableToTypeOfMatcher{xt} - } - return assignableToTypeOfMatcher{reflect.TypeOf(x)} -} - -// InAnyOrder is a Matcher that returns true for collections of the same elements ignoring the order. -// -// Example usage: -// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 3, 2}) // returns true -// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 2}) // returns false -func InAnyOrder(x interface{}) Matcher { - return inAnyOrderMatcher{x} -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 67645f7a7..5440d4d6a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -349,9 +349,6 @@ github.com/golang/groupcache/consistenthash github.com/golang/groupcache/groupcachepb github.com/golang/groupcache/lru github.com/golang/groupcache/singleflight -# github.com/golang/mock v1.6.0 -## explicit; go 1.11 -github.com/golang/mock/gomock # github.com/golang/protobuf v1.5.3 ## explicit; go 1.9 github.com/golang/protobuf/proto