diff --git a/Makefile b/Makefile index 54943d30..a84039ed 100755 --- a/Makefile +++ b/Makefile @@ -508,48 +508,7 @@ proto-format: @echo "Formatting Protobuf files" @$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \; -.PHONY: proto-all proto-gen proto-format proto-lint proto-check-breaking - - -TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.15/proto/tendermint -GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos -COSMOS_SDK_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.45.1 -ETHERMINT_URL = https://raw.githubusercontent.com/Canto-Network/ethermint-v2/v0.10.0 -IBC_GO_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v3.0.0-rc0 -COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master - -TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto -TM_ABCI_TYPES = third_party/proto/tendermint/abci -TM_TYPES = third_party/proto/tendermint/types - -GOGO_PROTO_TYPES = third_party/proto/gogoproto - -COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto - -proto-update-deps: - @mkdir -p $(GOGO_PROTO_TYPES) - @curl -sSL $(GOGO_PROTO_URL)/gogoproto/gogo.proto > $(GOGO_PROTO_TYPES)/gogo.proto - - @mkdir -p $(COSMOS_PROTO_TYPES) - @curl -sSL $(COSMOS_PROTO_URL)/cosmos.proto > $(COSMOS_PROTO_TYPES)/cosmos.proto - -## Importing of tendermint protobuf definitions currently requires the -## use of `sed` in order to build properly with cosmos-sdk's proto file layout -## (which is the standard Buf.build FILE_LAYOUT) -## Issue link: https://github.com/tendermint/tendermint/issues/5021 - @mkdir -p $(TM_ABCI_TYPES) - @curl -sSL $(TM_URL)/abci/types.proto > $(TM_ABCI_TYPES)/types.proto - - @mkdir -p $(TM_TYPES) - @curl -sSL $(TM_URL)/types/types.proto > $(TM_TYPES)/types.proto - - @mkdir -p $(TM_CRYPTO_TYPES) - @curl -sSL $(TM_URL)/crypto/proof.proto > $(TM_CRYPTO_TYPES)/proof.proto - @curl -sSL $(TM_URL)/crypto/keys.proto > $(TM_CRYPTO_TYPES)/keys.proto - - - -.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps +.PHONY: proto-all proto-gen proto-lint proto-check-breaking proto-swagger-gen proto-format ############################################################################### ### Localnet ### diff --git a/go.mod b/go.mod index 8b8932f4..7f72319c 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,6 @@ require ( github.com/cosmos/rosetta v0.0.0-20231205133638-3bc76705a1c6 github.com/ethereum/go-ethereum v1.10.26 github.com/evmos/ethermint v0.22.0 - github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -88,6 +87,7 @@ require ( github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/gogo/googleapis v1.4.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/google/go-cmp v0.6.0 // indirect diff --git a/scripts/proto-tools-installer.sh b/scripts/proto-tools-installer.sh index 1a947df7..2d9d24e6 100755 --- a/scripts/proto-tools-installer.sh +++ b/scripts/proto-tools-installer.sh @@ -83,18 +83,6 @@ f_install_buf() { f_print_done } -f_install_protoc_gen_gocosmos() { - f_print_installing_with_padding protoc-gen-gocosmos - - if ! grep "github.com/gogo/protobuf => github.com/regen-network/protobuf" go.mod &>/dev/null ; then - echo -e "\tPlease run this command from somewhere inside the canto folder." - return 1 - fi - - go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos 2>/dev/null - f_print_done -} - f_install_protoc_gen_grpc_gateway() { f_print_installing_with_padding protoc-gen-grpc-gateway f_needs_install "${DESTDIR}/${PREFIX}/bin/protoc-gen-grpc-gateway" || return 0 @@ -149,7 +137,6 @@ f_ensure_tools f_ensure_dirs f_install_protoc f_install_buf -f_install_protoc_gen_gocosmos f_install_protoc_gen_grpc_gateway f_install_protoc_gen_swagger f_install_clang_format diff --git a/x/coinswap/keeper/keeper.go b/x/coinswap/keeper/keeper.go index 34c5f644..eb389c00 100644 --- a/x/coinswap/keeper/keeper.go +++ b/x/coinswap/keeper/keeper.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - gogotypes "github.com/gogo/protobuf/types" + gogoprototypes "github.com/cosmos/gogoproto/types" "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" @@ -352,7 +352,7 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { // SetStandardDenom sets the standard denom for the coinswap module. func (k Keeper) SetStandardDenom(ctx sdk.Context, denom string) error { store := k.storeService.OpenKVStore(ctx) - denomWrap := gogotypes.StringValue{Value: denom} + denomWrap := gogoprototypes.StringValue{Value: denom} bz := k.cdc.MustMarshal(&denomWrap) err := store.Set(types.KeyStandardDenom, bz) if err != nil { @@ -369,7 +369,7 @@ func (k Keeper) GetStandardDenom(ctx sdk.Context) (string, error) { return "", err } - var denomWrap = gogotypes.StringValue{} + var denomWrap = gogoprototypes.StringValue{} k.cdc.MustUnmarshal(bz, &denomWrap) return denomWrap.Value, nil } diff --git a/x/coinswap/keeper/pool.go b/x/coinswap/keeper/pool.go index 406b9e96..eeeb8958 100644 --- a/x/coinswap/keeper/pool.go +++ b/x/coinswap/keeper/pool.go @@ -3,7 +3,7 @@ package keeper import ( "fmt" - gogotypes "github.com/gogo/protobuf/types" + gogoprototypes "github.com/cosmos/gogoproto/types" errorsmod "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" @@ -64,7 +64,7 @@ func (k Keeper) GetPoolByLptDenom(ctx sdk.Context, lptDenom string) (types.Pool, return types.Pool{}, false } - poolId := &gogotypes.StringValue{} + poolId := &gogoprototypes.StringValue{} k.cdc.MustUnmarshal(bz, poolId) return k.GetPool(ctx, poolId.Value) } @@ -138,7 +138,7 @@ func (k Keeper) setPool(ctx sdk.Context, pool *types.Pool) { store.Set(types.GetPoolKey(pool.Id), bz) // save by lpt denom - poolId := &gogotypes.StringValue{Value: pool.Id} + poolId := &gogoprototypes.StringValue{Value: pool.Id} poolIdBz := k.cdc.MustMarshal(poolId) store.Set(types.GetLptDenomKey(pool.LptDenom), poolIdBz) } diff --git a/x/coinswap/module.go b/x/coinswap/module.go index 42c68241..5b0731df 100644 --- a/x/coinswap/module.go +++ b/x/coinswap/module.go @@ -11,6 +11,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/core/appmodule" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -25,9 +26,13 @@ import ( ) var ( - _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // AppModuleBasic defines the basic application module used by the coinswap module. diff --git a/x/csr/module.go b/x/csr/module.go index 1a20eaab..97fd9678 100644 --- a/x/csr/module.go +++ b/x/csr/module.go @@ -10,9 +10,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "github.com/Canto-Network/Canto/v7/x/csr/client/cli" - "github.com/Canto-Network/Canto/v7/x/csr/keeper" - "github.com/Canto-Network/Canto/v7/x/csr/types" + "cosmossdk.io/core/appmodule" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -20,11 +18,20 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + + "github.com/Canto-Network/Canto/v7/x/csr/client/cli" + "github.com/Canto-Network/Canto/v7/x/csr/keeper" + "github.com/Canto-Network/Canto/v7/x/csr/types" ) var ( - _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // ---------------------------------------------------------------------------- diff --git a/x/epochs/module.go b/x/epochs/module.go index 06cad8fe..7eff2e93 100644 --- a/x/epochs/module.go +++ b/x/epochs/module.go @@ -14,6 +14,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/core/appmodule" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -26,8 +27,13 @@ import ( ) var ( - _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // ---------------------------------------------------------------------------- diff --git a/x/erc20/module.go b/x/erc20/module.go index 1d87c76c..d29a534e 100644 --- a/x/erc20/module.go +++ b/x/erc20/module.go @@ -6,7 +6,11 @@ import ( "fmt" "math/rand" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -15,8 +19,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" "github.com/Canto-Network/Canto/v7/x/erc20/client/cli" "github.com/Canto-Network/Canto/v7/x/erc20/keeper" @@ -25,9 +27,12 @@ import ( // type check to ensure the interface is properly implemented var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // app module Basics object diff --git a/x/govshuttle/module.go b/x/govshuttle/module.go index 37bcf9e1..c439f796 100644 --- a/x/govshuttle/module.go +++ b/x/govshuttle/module.go @@ -11,20 +11,27 @@ import ( abci "github.com/cometbft/cometbft/abci/types" - "github.com/Canto-Network/Canto/v7/x/govshuttle/client/cli" - "github.com/Canto-Network/Canto/v7/x/govshuttle/keeper" - "github.com/Canto-Network/Canto/v7/x/govshuttle/types" + "cosmossdk.io/core/appmodule" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + + "github.com/Canto-Network/Canto/v7/x/govshuttle/client/cli" + "github.com/Canto-Network/Canto/v7/x/govshuttle/keeper" + "github.com/Canto-Network/Canto/v7/x/govshuttle/types" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // ---------------------------------------------------------------------------- diff --git a/x/inflation/module.go b/x/inflation/module.go index 09012567..55d09f32 100644 --- a/x/inflation/module.go +++ b/x/inflation/module.go @@ -6,6 +6,10 @@ import ( "fmt" "math/rand" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + "cosmossdk.io/core/appmodule" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -16,8 +20,6 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" "github.com/Canto-Network/Canto/v7/x/inflation/client/cli" "github.com/Canto-Network/Canto/v7/x/inflation/keeper" @@ -26,9 +28,12 @@ import ( // type check to ensure the interface is properly implemented var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // app module Basics object diff --git a/x/onboarding/module.go b/x/onboarding/module.go index 7cbac388..af246e13 100644 --- a/x/onboarding/module.go +++ b/x/onboarding/module.go @@ -12,6 +12,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/core/appmodule" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -26,9 +27,12 @@ import ( // type check to ensure the interface is properly implemented var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleSimulation = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // app module Basics object