Skip to content

Commit

Permalink
chore: add module.go compiler assertions (cosmos#4650)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner authored Sep 14, 2023
1 parent b16a32c commit adfeb2a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
7 changes: 3 additions & 4 deletions modules/apps/27-interchain-accounts/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ var (
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)
_ module.HasGenesis = (*AppModule)(nil)
_ module.HasName = (*AppModule)(nil)
_ module.HasConsensusVersion = (*AppModule)(nil)
_ module.HasServices = (*AppModule)(nil)
_ module.HasProposalMsgs = (*AppModule)(nil)
_ appmodule.AppModule = (*AppModule)(nil)

Expand Down Expand Up @@ -139,10 +142,6 @@ func (am AppModule) InitModule(ctx sdk.Context, controllerParams controllertypes
}
}

// RegisterInvariants implements the AppModule interface
func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
}

// RegisterServices registers module services
func (am AppModule) RegisterServices(cfg module.Configurator) {
if am.controllerKeeper != nil {
Expand Down
16 changes: 8 additions & 8 deletions modules/apps/29-fee/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ import (
)

var (
_ module.AppModule = (*AppModule)(nil)
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ module.HasGenesis = (*AppModule)(nil)
_ appmodule.AppModule = (*AppModule)(nil)
_ module.AppModule = (*AppModule)(nil)
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)
_ module.HasGenesis = (*AppModule)(nil)
_ module.HasName = (*AppModule)(nil)
_ module.HasConsensusVersion = (*AppModule)(nil)
_ module.HasServices = (*AppModule)(nil)
_ appmodule.AppModule = (*AppModule)(nil)
)

// AppModuleBasic is the 29-fee AppModuleBasic
Expand Down Expand Up @@ -98,10 +102,6 @@ func NewAppModule(k keeper.Keeper) AppModule {
}
}

// RegisterInvariants implements the AppModule interface
func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
}

// RegisterServices registers module services.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterMsgServer(cfg.MsgServer(), am.keeper)
Expand Down
18 changes: 12 additions & 6 deletions modules/apps/transfer/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ import (
)

var (
_ module.AppModule = (*AppModule)(nil)
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ module.HasGenesis = (*AppModule)(nil)
_ module.HasProposalMsgs = (*AppModule)(nil)
_ appmodule.AppModule = (*AppModule)(nil)
_ porttypes.IBCModule = (*IBCModule)(nil)
_ module.AppModule = (*AppModule)(nil)
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)
_ module.HasGenesis = (*AppModule)(nil)
_ module.HasName = (*AppModule)(nil)
_ module.HasConsensusVersion = (*AppModule)(nil)
_ module.HasInvariants = (*AppModule)(nil)
_ module.HasServices = (*AppModule)(nil)
_ module.HasProposalMsgs = (*AppModule)(nil)
_ appmodule.AppModule = (*AppModule)(nil)

_ porttypes.IBCModule = (*IBCModule)(nil)
)

// AppModuleBasic is the IBC Transfer AppModuleBasic
Expand Down
8 changes: 3 additions & 5 deletions modules/core/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ var (
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)
_ module.HasGenesis = (*AppModule)(nil)
_ module.HasName = (*AppModule)(nil)
_ module.HasConsensusVersion = (*AppModule)(nil)
_ module.HasServices = (*AppModule)(nil)
_ module.HasProposalMsgs = (*AppModule)(nil)
_ appmodule.AppModule = (*AppModule)(nil)
_ appmodule.HasBeginBlocker = (*AppModule)(nil)
Expand Down Expand Up @@ -122,11 +125,6 @@ func (AppModule) Name() string {
return exported.ModuleName
}

// RegisterInvariants registers the ibc module invariants.
func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
// TODO:
}

// RegisterServices registers module services.
func (am AppModule) RegisterServices(cfg module.Configurator) {
clienttypes.RegisterMsgServer(cfg.MsgServer(), am.keeper)
Expand Down

0 comments on commit adfeb2a

Please sign in to comment.