Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement appmodule.AppModule interface for ibc-go packages' modules #4332

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions modules/apps/27-interchain-accounts/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

Check failure on line 10 in modules/apps/27-interchain-accounts/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand All @@ -17,6 +17,7 @@

abci "github.com/cometbft/cometbft/abci/types"

"cosmossdk.io/core/appmodule"

Check failure on line 20 in modules/apps/27-interchain-accounts/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
"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"
Expand All @@ -34,6 +35,7 @@
_ module.AppModule = (*AppModule)(nil)
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)
_ appmodule.AppModule = (*AppModule)(nil)

_ porttypes.IBCModule = (*host.IBCModule)(nil)
)
Expand All @@ -46,6 +48,12 @@
return types.ModuleName
}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}

Check warning on line 52 in modules/apps/27-interchain-accounts/module.go

View workflow job for this annotation

GitHub Actions / lint

unused-receiver: method receiver 'am' is not referenced in method's body, consider removing or renaming it as _ (revive)

// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}

Check warning on line 55 in modules/apps/27-interchain-accounts/module.go

View workflow job for this annotation

GitHub Actions / lint

unused-receiver: method receiver 'am' is not referenced in method's body, consider removing or renaming it as _ (revive)

// RegisterLegacyAminoCodec implements AppModuleBasic.
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}

Expand Down
9 changes: 9 additions & 0 deletions modules/apps/29-fee/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

Check failure on line 10 in modules/apps/29-fee/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand All @@ -17,14 +17,17 @@

abci "github.com/cometbft/cometbft/abci/types"

"cosmossdk.io/core/appmodule"

Check failure on line 20 in modules/apps/29-fee/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
"github.com/cosmos/ibc-go/v7/modules/apps/29-fee/client/cli"

Check failure on line 22 in modules/apps/29-fee/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
"github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper"
"github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"
)

var (
_ module.AppModule = (*AppModule)(nil)
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ appmodule.AppModule = (*AppModule)(nil)
)

// AppModuleBasic is the 29-fee AppModuleBasic
Expand All @@ -35,6 +38,12 @@
return types.ModuleName
}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}

Check warning on line 42 in modules/apps/29-fee/module.go

View workflow job for this annotation

GitHub Actions / lint

unused-receiver: method receiver 'am' is not referenced in method's body, consider removing or renaming it as _ (revive)

// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}

Check warning on line 45 in modules/apps/29-fee/module.go

View workflow job for this annotation

GitHub Actions / lint

unused-receiver: method receiver 'am' is not referenced in method's body, consider removing or renaming it as _ (revive)

// RegisterLegacyAminoCodec implements AppModuleBasic interface
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}

Expand Down
8 changes: 8 additions & 0 deletions modules/apps/transfer/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"encoding/json"
"fmt"

"cosmossdk.io/core/appmodule"

Check failure on line 8 in modules/apps/transfer/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

Check failure on line 11 in modules/apps/transfer/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand All @@ -27,6 +28,7 @@
var (
_ module.AppModule = (*AppModule)(nil)
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ appmodule.AppModule = (*AppModule)(nil)
_ porttypes.IBCModule = (*IBCModule)(nil)
)

Expand All @@ -38,6 +40,12 @@
return types.ModuleName
}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}

Check warning on line 44 in modules/apps/transfer/module.go

View workflow job for this annotation

GitHub Actions / lint

unused-receiver: method receiver 'am' is not referenced in method's body, consider removing or renaming it as _ (revive)

// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}

Check warning on line 47 in modules/apps/transfer/module.go

View workflow job for this annotation

GitHub Actions / lint

unused-receiver: method receiver 'am' is not referenced in method's body, consider removing or renaming it as _ (revive)

// RegisterLegacyAminoCodec implements AppModuleBasic interface
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
types.RegisterLegacyAminoCodec(cdc)
Expand Down
8 changes: 8 additions & 0 deletions modules/core/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"encoding/json"
"fmt"

"cosmossdk.io/core/appmodule"

Check failure on line 8 in modules/core/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

Check failure on line 11 in modules/core/module.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/ibc-go) --custom-order (gci)
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand All @@ -34,6 +35,7 @@
_ 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.
Expand All @@ -44,6 +46,12 @@
return exported.ModuleName
}

// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}

Check warning on line 50 in modules/core/module.go

View workflow job for this annotation

GitHub Actions / lint

unused-receiver: method receiver 'am' is not referenced in method's body, consider removing or renaming it as _ (revive)

// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}

Check warning on line 53 in modules/core/module.go

View workflow job for this annotation

GitHub Actions / lint

unused-receiver: method receiver 'am' is not referenced in method's body, consider removing or renaming it as _ (revive)

// RegisterLegacyAminoCodec does nothing. IBC does not support amino.
func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {}

Expand Down
12 changes: 4 additions & 8 deletions testing/simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
}
Expand All @@ -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"},
Expand All @@ -236,12 +236,10 @@ func queryCommand(basicManager module.BasicManager) *cobra.Command {
authcmd.GetSimulateCmd(),
)

basicManager.AddQueryCommands(cmd)

return cmd
}

func txCommand(basicManager module.BasicManager) *cobra.Command {
func txCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "tx",
Short: "Transactions subcommands",
Expand All @@ -262,8 +260,6 @@ func txCommand(basicManager module.BasicManager) *cobra.Command {
authcmd.GetAuxToFeeCommand(),
)

basicManager.AddTxCommands(cmd)

return cmd
}

Expand Down
Loading