Skip to content

Commit

Permalink
refactor(sudo): clean up module
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yang committed Jun 28, 2023
1 parent 3a77438 commit a55bc24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
14 changes: 1 addition & 13 deletions x/sudo/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -48,12 +47,8 @@ func (AppModuleBasic) RegisterInterfaces(interfaceRegistry codectypes.InterfaceR
pb.RegisterInterfaces(interfaceRegistry)
}

func (AppModuleBasic) RegisterCodec(aminoCodec *codec.LegacyAmino) {
pb.RegisterCodec(aminoCodec)
}

func (AppModuleBasic) RegisterLegacyAminoCodec(aminoCodec *codec.LegacyAmino) {
pb.RegisterCodec(aminoCodec)
pb.RegisterLegacyAminoCodec(aminoCodec)
}

// DefaultGenesis returns default genesis state as raw bytes for the module.
Expand All @@ -72,10 +67,6 @@ func (AppModuleBasic) ValidateGenesis(
return genState.Validate()
}

// RegisterRESTRoutes registers the capability module's REST service handlers.
func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {
}

// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.
func (AppModuleBasic) RegisterGRPCGatewayRoutes(
clientCtx client.Context, mux *runtime.ServeMux,
Expand Down Expand Up @@ -121,9 +112,6 @@ func (am AppModule) Name() string {
return am.AppModuleBasic.Name()
}

// QuerierRoute returns the capability module's query routing key.
func (AppModule) QuerierRoute() string { return pb.QuerierRoute }

// RegisterServices registers a GRPC query service to respond to the
// module-specific GRPC queries.
func (am AppModule) RegisterServices(cfg module.Configurator) {
Expand Down
3 changes: 1 addition & 2 deletions x/sudo/pb/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/msgservice"
)

func RegisterCodec(cdc *codec.LegacyAmino) {
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgEditSudoers{}, "sudo/edit_sudoers", nil)
}

Expand All @@ -22,6 +22,5 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
}

var (
Amino = codec.NewLegacyAmino()
ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry())
)

0 comments on commit a55bc24

Please sign in to comment.