From ccda4abef7071189c088ac79894e6e834b19b555 Mon Sep 17 00:00:00 2001 From: dudong2 Date: Tue, 2 Jul 2024 14:35:28 +0900 Subject: [PATCH] feat: Check interface of all modules --- x/coinswap/module.go | 8 +++++++- x/csr/module.go | 16 ++++++++++++---- x/epochs/module.go | 12 ++++++++++-- x/erc20/module.go | 13 ++++++++++--- x/govshuttle/module.go | 18 +++++++++++++----- x/inflation/module.go | 13 ++++++++++--- 6 files changed, 62 insertions(+), 18 deletions(-) diff --git a/x/coinswap/module.go b/x/coinswap/module.go index 42c682419..4ee064e95 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,14 @@ import ( ) var ( - _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasInvariants = 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 1a20eaabc..a163709ba 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,21 @@ 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.HasInvariants = 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 06cad8fe2..362fe5006 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,15 @@ import ( ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasInvariants = 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 468f315a4..276e4271b 100644 --- a/x/erc20/module.go +++ b/x/erc20/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/client" "github.com/cosmos/cosmos-sdk/codec" @@ -14,8 +18,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" @@ -24,9 +26,14 @@ import ( // type check to ensure the interface is properly implemented var ( - _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasInvariants = 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 37bcf9e15..bfbdae8f1 100644 --- a/x/govshuttle/module.go +++ b/x/govshuttle/module.go @@ -11,20 +11,28 @@ 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.HasInvariants = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // ---------------------------------------------------------------------------- diff --git a/x/inflation/module.go b/x/inflation/module.go index 090125675..90382483e 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,14 @@ import ( // type check to ensure the interface is properly implemented var ( - _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasInvariants = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // app module Basics object