Documentation ¶
Index ¶
- Constants
- Variables
- func InitGenesis(ctx sdk.Context, router *Router, data GenesisState)
- func NewAppModule(router *Router) module.AppModule
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type AppModule
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(_ *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(_ context.CLIContext, _ *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type GenesisState
- type Router
Constants ¶
const ( ModuleName = "router" // DefaultParamspace for params keeper DefaultParamspace = ModuleName )
Variables ¶
var ModuleCdc *codec.Codec
module codec
var ParamStoreKeyDisabledRoutes = []byte("disabledroutes")
ParamStoreKeyDisabledRoutes is store's key for DisabledRoutes
Functions ¶
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, router *Router, data GenesisState)
InitGenesis sets distribution information for genesis.
func NewAppModule ¶
NewAppModule creates a new AppModule object
func ParamKeyTable ¶
ParamKeyTable type declaration for parameters
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis performs basic validation of bank genesis data returning an error for any failed validation criteria.
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule implements an application module for the genutil module.
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis returns the exported genesis state as raw bytes for the genutil module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the genutil module. It returns no validator updates.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the togglerouter module.
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the genutil module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command
GetQueryCmd returns no root query command for the genutil module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(_ *codec.Codec) *cobra.Command
GetTxCmd returns no root tx command for the genutil module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the togglerouter module's name.
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers the togglerouter module's types for the given codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(_ context.CLIContext, _ *mux.Router)
RegisterRESTRoutes registers the REST routes for the genutil module.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the togglerouter module.
type GenesisState ¶
type GenesisState struct {
DisabledRoutes []string `json:"disabled_routes"`
}
GenesisState is the bank state that must be provided at genesis.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default genesis state
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, router *Router) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func NewGenesisState ¶
func NewGenesisState(disabledRoutes []string) GenesisState
NewGenesisState creates a new genesis state.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) AddRoute ¶
AddRoute adds a route path to the router with a given handler. The route must be alphanumeric.
func (*Router) GetRouteDisabled ¶
GetRouteEnabled returns whether a specific route is disabled from the global param store