-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AppModuleBasic for ibc authority (#16)
* Add AppModuleBasic for ibc authority * add README
- Loading branch information
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package ibc | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/grpc-ecosystem/grpc-gateway/runtime" | ||
|
||
"github.com/gorilla/mux" | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
"github.com/strangelove-ventures/paramauthority/x/ibc/client/cli" | ||
"github.com/strangelove-ventures/paramauthority/x/ibc/types" | ||
"github.com/strangelove-ventures/paramauthority/x/params/types/proposal" | ||
) | ||
|
||
var ( | ||
_ module.AppModuleBasic = AppModuleBasic{} | ||
) | ||
|
||
// AppModuleBasic defines the basic application module used by the params module. | ||
type AppModuleBasic struct{} | ||
|
||
// Name returns the params module's name. | ||
func (AppModuleBasic) Name() string { | ||
return types.ModuleName | ||
} | ||
|
||
// RegisterLegacyAminoCodec registers the params module's types on the given LegacyAmino codec. | ||
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { | ||
types.RegisterLegacyAminoCodec(cdc) | ||
} | ||
|
||
// DefaultGenesis returns default genesis state as raw bytes for the params | ||
// module. | ||
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { | ||
return cdc.MustMarshalJSON(proposal.DefaultGenesis()) | ||
} | ||
|
||
// ValidateGenesis performs genesis state validation for the params module. | ||
func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, config client.TxEncodingConfig, _ json.RawMessage) error { | ||
return nil | ||
} | ||
|
||
// RegisterRESTRoutes registers the REST routes for the params module. | ||
func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} | ||
|
||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the params module. | ||
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {} | ||
|
||
// GetTxCmd returns no root tx command for the params module. | ||
func (AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd() } | ||
|
||
// GetQueryCmd returns no root query command for the params module. | ||
func (AppModuleBasic) GetQueryCmd() *cobra.Command { | ||
return nil | ||
} | ||
|
||
func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { | ||
types.RegisterInterfaces(registry) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package types | ||
|
||
const ModuleName = "ibc-authority" |