From 26e43a37b7574762b7d618b306013b3f5b3a51ed Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 11 Aug 2023 12:46:39 +0200 Subject: [PATCH 1/7] implement for ica --- modules/apps/27-interchain-accounts/module.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/apps/27-interchain-accounts/module.go b/modules/apps/27-interchain-accounts/module.go index 9303de77fbc..e72864e4bb5 100644 --- a/modules/apps/27-interchain-accounts/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -17,6 +17,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/core/appmodule" "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/client/cli" controllerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" controllertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" @@ -34,6 +35,7 @@ var ( _ module.AppModule = (*AppModule)(nil) _ module.AppModuleBasic = (*AppModuleBasic)(nil) _ module.AppModuleSimulation = (*AppModule)(nil) + _ appmodule.AppModule = (*AppModule)(nil) _ porttypes.IBCModule = (*host.IBCModule)(nil) ) @@ -46,6 +48,12 @@ func (AppModuleBasic) Name() string { return types.ModuleName } +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + // RegisterLegacyAminoCodec implements AppModuleBasic. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} From 15feec18251720330d9c9fffc4a47b93322eb6b6 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 11 Aug 2023 12:49:10 +0200 Subject: [PATCH 2/7] implement for fee --- modules/apps/29-fee/module.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/apps/29-fee/module.go b/modules/apps/29-fee/module.go index fdc7c5fe977..cf357482d8f 100644 --- a/modules/apps/29-fee/module.go +++ b/modules/apps/29-fee/module.go @@ -17,7 +17,9 @@ import ( abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/core/appmodule" "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/client/cli" + "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper" "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" ) @@ -25,6 +27,7 @@ import ( var ( _ module.AppModule = (*AppModule)(nil) _ module.AppModuleBasic = (*AppModuleBasic)(nil) + _ appmodule.AppModule = (*AppModule)(nil) ) // AppModuleBasic is the 29-fee AppModuleBasic @@ -35,6 +38,12 @@ func (AppModuleBasic) Name() string { return types.ModuleName } +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + // RegisterLegacyAminoCodec implements AppModuleBasic interface func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} From 47b9360bc71cd195f24e6f9dc930ff0e2950378f Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 11 Aug 2023 12:51:03 +0200 Subject: [PATCH 3/7] implement for transfer --- modules/apps/transfer/module.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/apps/transfer/module.go b/modules/apps/transfer/module.go index 17721a818bb..07f608a661b 100644 --- a/modules/apps/transfer/module.go +++ b/modules/apps/transfer/module.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/core/appmodule" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -27,6 +28,7 @@ import ( var ( _ module.AppModule = (*AppModule)(nil) _ module.AppModuleBasic = (*AppModuleBasic)(nil) + _ appmodule.AppModule = (*AppModule)(nil) _ porttypes.IBCModule = (*IBCModule)(nil) ) @@ -38,6 +40,12 @@ func (AppModuleBasic) Name() string { return types.ModuleName } +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + // RegisterLegacyAminoCodec implements AppModuleBasic interface func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) From 4ee8bdff3d382456e203b1b7e8dee4ad47c8612a Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 11 Aug 2023 12:52:55 +0200 Subject: [PATCH 4/7] implement for core --- modules/core/module.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/core/module.go b/modules/core/module.go index dc9f59c011f..a00d2505b5a 100644 --- a/modules/core/module.go +++ b/modules/core/module.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" + "cosmossdk.io/core/appmodule" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -34,6 +35,7 @@ var ( _ module.AppModule = (*AppModule)(nil) _ module.AppModuleBasic = (*AppModuleBasic)(nil) _ module.AppModuleSimulation = (*AppModule)(nil) + _ appmodule.AppModule = (*AppModule)(nil) ) // AppModuleBasic defines the basic application module used by the ibc module. @@ -44,6 +46,12 @@ func (AppModuleBasic) Name() string { return exported.ModuleName } +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + // RegisterLegacyAminoCodec does nothing. IBC does not support amino. func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {} From 4a79b98847004514f2362b94632eebb0ca1dc315 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 11 Aug 2023 13:01:28 +0200 Subject: [PATCH 5/7] remove usage of basic manager in commands --- testing/simapp/simd/cmd/root.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/testing/simapp/simd/cmd/root.go b/testing/simapp/simd/cmd/root.go index 5ac6a9f1cb0..ef4d344a35e 100644 --- a/testing/simapp/simd/cmd/root.go +++ b/testing/simapp/simd/cmd/root.go @@ -236,8 +236,6 @@ func queryCommand(basicManager module.BasicManager) *cobra.Command { authcmd.GetSimulateCmd(), ) - basicManager.AddQueryCommands(cmd) - return cmd } @@ -262,8 +260,6 @@ func txCommand(basicManager module.BasicManager) *cobra.Command { authcmd.GetAuxToFeeCommand(), ) - basicManager.AddTxCommands(cmd) - return cmd } From bb15914291f38da50b616f2dd2ee7762e7954784 Mon Sep 17 00:00:00 2001 From: Ruslan Akhtariev Date: Fri, 11 Aug 2023 13:02:59 +0200 Subject: [PATCH 6/7] remove basic managers from tx/q cmds arguments --- testing/simapp/simd/cmd/root.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/simapp/simd/cmd/root.go b/testing/simapp/simd/cmd/root.go index ef4d344a35e..0d7d39d60e9 100644 --- a/testing/simapp/simd/cmd/root.go +++ b/testing/simapp/simd/cmd/root.go @@ -207,8 +207,8 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig, b rootCmd.AddCommand( rpc.StatusCommand(), genesisCommand(encodingConfig, basicManager), - txCommand(basicManager), - queryCommand(basicManager), + txCommand(), + queryCommand(), keys.Commands(), ) } @@ -217,7 +217,7 @@ func addModuleInitFlags(startCmd *cobra.Command) { crisis.AddModuleInitFlags(startCmd) } -func queryCommand(basicManager module.BasicManager) *cobra.Command { +func queryCommand() *cobra.Command { cmd := &cobra.Command{ Use: "query", Aliases: []string{"q"}, @@ -239,7 +239,7 @@ func queryCommand(basicManager module.BasicManager) *cobra.Command { return cmd } -func txCommand(basicManager module.BasicManager) *cobra.Command { +func txCommand() *cobra.Command { cmd := &cobra.Command{ Use: "tx", Short: "Transactions subcommands", From 815118caa943b8b23c400859c3826e7c2e4b3a7e Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Fri, 18 Aug 2023 00:16:59 +0300 Subject: [PATCH 7/7] Fix linting issues. --- modules/apps/27-interchain-accounts/module.go | 7 ++++--- modules/apps/29-fee/module.go | 8 ++++---- modules/apps/transfer/module.go | 7 ++++--- modules/core/module.go | 7 ++++--- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/modules/apps/27-interchain-accounts/module.go b/modules/apps/27-interchain-accounts/module.go index e72864e4bb5..91d7706701c 100644 --- a/modules/apps/27-interchain-accounts/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -8,6 +8,8 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -17,7 +19,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" - "cosmossdk.io/core/appmodule" "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/client/cli" controllerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" controllertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" @@ -49,10 +50,10 @@ func (AppModuleBasic) Name() string { } // IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} +func (AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} +func (AppModule) IsAppModule() {} // RegisterLegacyAminoCodec implements AppModuleBasic. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} diff --git a/modules/apps/29-fee/module.go b/modules/apps/29-fee/module.go index cf357482d8f..9639430817e 100644 --- a/modules/apps/29-fee/module.go +++ b/modules/apps/29-fee/module.go @@ -8,6 +8,8 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -17,9 +19,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" - "cosmossdk.io/core/appmodule" "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/client/cli" - "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper" "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" ) @@ -39,10 +39,10 @@ func (AppModuleBasic) Name() string { } // IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} +func (AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} +func (AppModule) IsAppModule() {} // RegisterLegacyAminoCodec implements AppModuleBasic interface func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} diff --git a/modules/apps/transfer/module.go b/modules/apps/transfer/module.go index 07f608a661b..52c54edfb3c 100644 --- a/modules/apps/transfer/module.go +++ b/modules/apps/transfer/module.go @@ -5,10 +5,11 @@ import ( "encoding/json" "fmt" - "cosmossdk.io/core/appmodule" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -41,10 +42,10 @@ func (AppModuleBasic) Name() string { } // IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} +func (AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} +func (AppModule) IsAppModule() {} // RegisterLegacyAminoCodec implements AppModuleBasic interface func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { diff --git a/modules/core/module.go b/modules/core/module.go index a00d2505b5a..8c671b4b850 100644 --- a/modules/core/module.go +++ b/modules/core/module.go @@ -5,10 +5,11 @@ import ( "encoding/json" "fmt" - "cosmossdk.io/core/appmodule" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -47,10 +48,10 @@ func (AppModuleBasic) Name() string { } // IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} +func (AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} +func (AppModule) IsAppModule() {} // RegisterLegacyAminoCodec does nothing. IBC does not support amino. func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {}