diff --git a/Makefile b/Makefile index d0b71fee8..3465c34ff 100644 --- a/Makefile +++ b/Makefile @@ -342,27 +342,6 @@ lint-fix: -w {} \; $(MAKE) vendor -mock: ##@other Regenerate mocks - mockgen -package=fake -destination=transactions/fake/mock.go -source=transactions/fake/txservice.go - mockgen -package=peer -destination=services/peer/discoverer_mock.go -source=services/peer/service.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_ethclient -destination=rpc/chain/mock/client/ethclient/eth_client.go -source=rpc/chain/ethclient/eth_client.go - mockgen -package=mock_ethclient -destination=rpc/chain/mock/client/ethclient/rps_limited_eth_client.go -source=rpc/chain/ethclient/rps_limited_eth_client.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. docker run --privileged --rm -it -v "$(PWD):$(DOCKER_TEST_WORKDIR)" -w "$(DOCKER_TEST_WORKDIR)" $(DOCKER_TEST_IMAGE) go test ${ARGS} diff --git a/contracts/contracts.go b/contracts/contracts.go index f5f123f9e..b59a563e5 100644 --- a/contracts/contracts.go +++ b/contracts/contracts.go @@ -1,5 +1,7 @@ package contracts +//go:generate mockgen -source=contracts.go -destination=mock/contracts.go + import ( "errors" diff --git a/multiaccounts/settings/database_settings_manager.go b/multiaccounts/settings/database_settings_manager.go index 7a09c940f..1fa79eb5b 100644 --- a/multiaccounts/settings/database_settings_manager.go +++ b/multiaccounts/settings/database_settings_manager.go @@ -1,5 +1,7 @@ package settings +//go:generate mockgen -package=mocksettings -source=database_settings_manager.go -destination=mocks/database_settings_manager_mock.go + import ( "database/sql" "encoding/json" diff --git a/rpc/chain/client.go b/rpc/chain/client.go index 24741d161..668e8aade 100644 --- a/rpc/chain/client.go +++ b/rpc/chain/client.go @@ -1,6 +1,6 @@ package chain -//go:generate mockgen -package=mock_client -source=client.go -destination=mock/client/client.go +//go:generate mockgen -package=mock_client -package=mock_client -source=client.go -destination=mock/client/client.go import ( "context" diff --git a/rpc/chain/ethclient/eth_client.go b/rpc/chain/ethclient/eth_client.go index 330d33223..5c4d09253 100644 --- a/rpc/chain/ethclient/eth_client.go +++ b/rpc/chain/ethclient/eth_client.go @@ -1,5 +1,7 @@ package ethclient +//go:generate mockgen -package=mock_ethclient -source=eth_client.go -destination=mock/client/ethclient/eth_client.go + import ( "context" "math/big" diff --git a/rpc/chain/ethclient/rps_limited_eth_client.go b/rpc/chain/ethclient/rps_limited_eth_client.go index f0aafd1aa..193f1a0ba 100644 --- a/rpc/chain/ethclient/rps_limited_eth_client.go +++ b/rpc/chain/ethclient/rps_limited_eth_client.go @@ -1,5 +1,7 @@ package ethclient +//go:generate mockgen -package=mock_ethclient -source=rps_limited_eth_client.go -destination=mock/client/ethclient/rps_limited_eth_client.go + import ( "github.com/ethereum/go-ethereum/rpc" "github.com/status-im/status-go/rpc/chain/rpclimiter" diff --git a/rpc/network/network.go b/rpc/network/network.go index 6a0eda02a..95338bfa2 100644 --- a/rpc/network/network.go +++ b/rpc/network/network.go @@ -1,6 +1,6 @@ package network -//go:generate mockgen -source=network.go -destination=mock/network.go +//go:generate mockgen -package=mock_network -source=network.go -destination=mock/network.go import ( "bytes" diff --git a/services/wallet/collectibles/collection_data_db.go b/services/wallet/collectibles/collection_data_db.go index a5ca3ef5f..0cbd59529 100644 --- a/services/wallet/collectibles/collection_data_db.go +++ b/services/wallet/collectibles/collection_data_db.go @@ -1,6 +1,6 @@ package collectibles -//go:generate mockgen -source=collection_data_db.go -destination=mock/collection_data_db.go +//go:generate mockgen -package=mock_collectibles -source=collection_data_db.go -destination=mock/collection_data_db.go import ( "database/sql" diff --git a/services/wallet/onramp/types.go b/services/wallet/onramp/types.go index bffc57fce..0abd2ee4a 100644 --- a/services/wallet/onramp/types.go +++ b/services/wallet/onramp/types.go @@ -1,6 +1,6 @@ package onramp -//go:generate mockgen -source=types.go -destination=mock/types.go +//go:generate mockgen -package=mock_onramp -source=types.go -destination=mock/types.go import ( "context" diff --git a/services/wallet/router/pathprocessor/processor.go b/services/wallet/router/pathprocessor/processor.go index 389ce33b9..3c4b7d226 100644 --- a/services/wallet/router/pathprocessor/processor.go +++ b/services/wallet/router/pathprocessor/processor.go @@ -1,6 +1,6 @@ package pathprocessor -//go:generate mockgen -source=processor.go -destination=mock_pathprocessor/processor.go +//go:generate mockgen -package=mock_pathprocessor -source=processor.go -destination=mock_pathprocessor/processor.go import ( "math/big" diff --git a/services/wallet/thirdparty/collectible_types.go b/services/wallet/thirdparty/collectible_types.go index 559ad028d..5f12b7ba2 100644 --- a/services/wallet/thirdparty/collectible_types.go +++ b/services/wallet/thirdparty/collectible_types.go @@ -1,6 +1,6 @@ package thirdparty -//go:generate mockgen -source=collectible_types.go -destination=mock/collectible_types.go +//go:generate mockgen -package=mock_thirdparty -source=collectible_types.go -destination=mock/collectible_types.go import ( "context" diff --git a/services/wallet/thirdparty/paraswap/types.go b/services/wallet/thirdparty/paraswap/types.go index f5e375503..174b7bb3d 100644 --- a/services/wallet/thirdparty/paraswap/types.go +++ b/services/wallet/thirdparty/paraswap/types.go @@ -1,6 +1,6 @@ package paraswap -//go:generate mockgen -source=types.go -destination=mock/types.go +//go:generate mockgen -package=mock_paraswap -source=types.go -destination=mock/types.go import ( "context" diff --git a/services/wallet/thirdparty/types.go b/services/wallet/thirdparty/types.go index 49b18504e..394c8d3d6 100644 --- a/services/wallet/thirdparty/types.go +++ b/services/wallet/thirdparty/types.go @@ -1,6 +1,6 @@ package thirdparty -//go:generate mockgen -source=services/wallet/thirdparty/types.go -destination=services/wallet/thirdparty/mock/types.go +//go:generate mockgen -package=mock_thirdparty -source=services/wallet/thirdparty/types.go -destination=services/wallet/thirdparty/mock/types.go type HistoricalPrice struct { Timestamp int64 `json:"time"`