refactor: remove unnecessary modules methods (#15436)
This commit is contained in:
parent
2c75a5fa63
commit
1a1536aa8e
@ -126,9 +126,6 @@ func (AppModule) Name() string {
|
||||
return types.ModuleName
|
||||
}
|
||||
|
||||
// RegisterInvariants performs a no-op.
|
||||
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
|
||||
|
||||
// RegisterServices registers a GRPC query service to respond to the
|
||||
// module-specific GRPC queries.
|
||||
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||
|
||||
@ -98,9 +98,6 @@ func (am AppModule) IsOnePerModuleType() {}
|
||||
// IsAppModule implements the appmodule.AppModule interface.
|
||||
func (am AppModule) IsAppModule() {}
|
||||
|
||||
// RegisterInvariants performs a no-op; there are no invariants to enforce.
|
||||
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
|
||||
|
||||
// RegisterServices registers module services.
|
||||
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||
types.RegisterMsgServer(cfg.MsgServer(), NewMsgServerImpl(am.accountKeeper, am.bankKeeper))
|
||||
|
||||
@ -134,13 +134,6 @@ func (AppModule) Name() string {
|
||||
return authz.ModuleName
|
||||
}
|
||||
|
||||
// RegisterInvariants does nothing, there are no invariants to enforce
|
||||
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
|
||||
|
||||
func (am AppModule) NewHandler() sdk.Handler {
|
||||
return nil
|
||||
}
|
||||
|
||||
// InitGenesis performs genesis initialization for the authz module. It returns
|
||||
// no validator updates.
|
||||
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
|
||||
|
||||
@ -128,9 +128,6 @@ func (am AppModule) ExportGenesis(sdk.Context, codec.JSONCodec) json.RawMessage
|
||||
// ConsensusVersion implements AppModule/ConsensusVersion.
|
||||
func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }
|
||||
|
||||
// RegisterInvariants does nothing, there are no invariants to enforce
|
||||
func (am AppModule) RegisterInvariants(sdk.InvariantRegistry) {}
|
||||
|
||||
func init() {
|
||||
appmodule.Register(
|
||||
&modulev1.Module{},
|
||||
|
||||
@ -138,9 +138,6 @@ func (AppModule) Name() string {
|
||||
return types.ModuleName
|
||||
}
|
||||
|
||||
// RegisterInvariants performs a no-op.
|
||||
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
|
||||
|
||||
// RegisterServices registers module services.
|
||||
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||
types.RegisterMsgServer(cfg.MsgServer(), am.keeper)
|
||||
|
||||
@ -141,9 +141,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
|
||||
}
|
||||
|
||||
// RegisterInvariants registers the evidence module's invariants.
|
||||
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {}
|
||||
|
||||
// InitGenesis performs the evidence module's genesis initialization It returns
|
||||
// no validator updates.
|
||||
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.RawMessage) []abci.ValidatorUpdate {
|
||||
|
||||
@ -142,9 +142,6 @@ func (AppModule) Name() string {
|
||||
return feegrant.ModuleName
|
||||
}
|
||||
|
||||
// RegisterInvariants registers the feegrant module invariants.
|
||||
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {}
|
||||
|
||||
// InitGenesis performs genesis initialization for the feegrant module. It returns
|
||||
// no validator updates.
|
||||
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.RawMessage) []abci.ValidatorUpdate {
|
||||
|
||||
@ -125,10 +125,6 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
|
||||
keeper.RegisterInvariants(ir, am.keeper)
|
||||
}
|
||||
|
||||
func (am AppModule) NewHandler() sdk.Handler {
|
||||
return nil
|
||||
}
|
||||
|
||||
// InitGenesis performs genesis initialization for the group module. It returns
|
||||
// no validator updates.
|
||||
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
|
||||
|
||||
@ -143,9 +143,6 @@ func (AppModule) Name() string {
|
||||
return types.ModuleName
|
||||
}
|
||||
|
||||
// RegisterInvariants registers the mint module invariants.
|
||||
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
|
||||
|
||||
// RegisterServices registers a gRPC query service to respond to the
|
||||
// module-specific gRPC queries.
|
||||
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||
|
||||
@ -126,13 +126,6 @@ func (AppModule) Name() string {
|
||||
return nft.ModuleName
|
||||
}
|
||||
|
||||
// RegisterInvariants does nothing, there are no invariants to enforce
|
||||
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
|
||||
|
||||
func (am AppModule) NewHandler() sdk.Handler {
|
||||
return nil
|
||||
}
|
||||
|
||||
// InitGenesis performs genesis initialization for the nft module. It returns
|
||||
// no validator updates.
|
||||
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
|
||||
|
||||
@ -2,24 +2,20 @@ package params
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
modulev1 "cosmossdk.io/api/cosmos/params/module/v1"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/depinject"
|
||||
|
||||
store "cosmossdk.io/store/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/params/client/cli"
|
||||
@ -34,6 +30,9 @@ var (
|
||||
_ module.AppModuleSimulation = AppModule{}
|
||||
)
|
||||
|
||||
// ConsensusVersion defines the current x/params module consensus version.
|
||||
const ConsensusVersion = 1
|
||||
|
||||
// AppModuleBasic defines the basic application module used by the params module.
|
||||
type AppModuleBasic struct{}
|
||||
|
||||
@ -47,15 +46,6 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
proposal.RegisterLegacyAminoCodec(cdc)
|
||||
}
|
||||
|
||||
// DefaultGenesis returns default genesis state as raw bytes for the params
|
||||
// module.
|
||||
func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage { return nil }
|
||||
|
||||
// ValidateGenesis performs genesis state validation for the params module.
|
||||
func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, config client.TxEncodingConfig, _ json.RawMessage) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the params module.
|
||||
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) {
|
||||
if err := proposal.RegisterQueryHandlerClient(context.Background(), mux, proposal.NewQueryClient(clientCtx)); err != nil {
|
||||
@ -98,13 +88,6 @@ func (am AppModule) IsOnePerModuleType() {}
|
||||
// IsAppModule implements the appmodule.AppModule interface.
|
||||
func (am AppModule) IsAppModule() {}
|
||||
|
||||
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
|
||||
|
||||
// InitGenesis performs a no-op.
|
||||
func (am AppModule) InitGenesis(_ sdk.Context, _ codec.JSONCodec, _ json.RawMessage) []abci.ValidatorUpdate {
|
||||
return []abci.ValidatorUpdate{}
|
||||
}
|
||||
|
||||
// GenerateGenesisState performs a no-op.
|
||||
func (AppModule) GenerateGenesisState(simState *module.SimulationState) {}
|
||||
|
||||
@ -122,13 +105,8 @@ func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.Weig
|
||||
return nil
|
||||
}
|
||||
|
||||
// ExportGenesis performs a no-op.
|
||||
func (am AppModule) ExportGenesis(_ sdk.Context, _ codec.JSONCodec) json.RawMessage {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ConsensusVersion implements AppModule/ConsensusVersion.
|
||||
func (AppModule) ConsensusVersion() uint64 { return 1 }
|
||||
func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }
|
||||
|
||||
//
|
||||
// App Wiring Setup
|
||||
|
||||
@ -133,9 +133,6 @@ func (AppModule) Name() string {
|
||||
return types.ModuleName
|
||||
}
|
||||
|
||||
// RegisterInvariants registers the slashing module invariants.
|
||||
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
|
||||
|
||||
// RegisterServices registers module services.
|
||||
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
|
||||
|
||||
@ -38,9 +38,8 @@ func init() {
|
||||
types.RegisterLegacyAminoCodec(codec.NewLegacyAmino())
|
||||
}
|
||||
|
||||
const (
|
||||
consensusVersion uint64 = 2
|
||||
)
|
||||
// ConsensusVersion defines the current x/upgrade module consensus version.
|
||||
const ConsensusVersion uint64 = 2
|
||||
|
||||
var (
|
||||
_ module.BeginBlockAppModule = AppModule{}
|
||||
@ -104,9 +103,6 @@ func (am AppModule) IsOnePerModuleType() {}
|
||||
// IsAppModule implements the appmodule.AppModule interface.
|
||||
func (am AppModule) IsAppModule() {}
|
||||
|
||||
// RegisterInvariants does nothing, there are no invariants to enforce
|
||||
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
|
||||
|
||||
// RegisterServices registers module services.
|
||||
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
|
||||
@ -153,7 +149,7 @@ func (am AppModule) ExportGenesis(_ sdk.Context, cdc codec.JSONCodec) json.RawMe
|
||||
}
|
||||
|
||||
// ConsensusVersion implements AppModule/ConsensusVersion.
|
||||
func (AppModule) ConsensusVersion() uint64 { return consensusVersion }
|
||||
func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }
|
||||
|
||||
// BeginBlock calls the upgrade module hooks
|
||||
//
|
||||
|
||||
Loading…
Reference in New Issue
Block a user