-
Notifications
You must be signed in to change notification settings - Fork 292
/
module.go
54 lines (42 loc) · 1.66 KB
/
module.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package params
import (
"encoding/json"
"github.com/gorilla/mux"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/module"
)
// AppModuleBasic defines the basic application module used by the slashing module.
type AppModuleBasic struct{}
var _ module.AppModuleBasic = AppModuleBasic{}
// Name returns the slashing module's name
func (AppModuleBasic) Name() string {
return CosmosAppModuleBasic{}.Name()
}
// RegisterCodec registers the slashing module's types for the given codec.
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec) {
RegisterCodec(cdc)
*CosmosModuleCdc = *ModuleCdc // nolint
}
// DefaultGenesis returns default genesis state as raw bytes for the slashing
// module.
func (AppModuleBasic) DefaultGenesis() json.RawMessage {
return CosmosAppModuleBasic{}.DefaultGenesis()
}
// ValidateGenesis performs genesis state validation for the slashing module.
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error {
return CosmosAppModuleBasic{}.ValidateGenesis(bz)
}
// RegisterRESTRoutes registers the REST routes for the slashing module.
func (AppModuleBasic) RegisterRESTRoutes(cliCtx context.CLIContext, route *mux.Router) {
CosmosAppModuleBasic{}.RegisterRESTRoutes(cliCtx, route)
}
// GetTxCmd returns the root tx command for the slashing module.
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command {
return CosmosAppModuleBasic{}.GetTxCmd(cdc)
}
// GetQueryCmd returns the root query command for the slashing module.
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command {
return CosmosAppModuleBasic{}.GetQueryCmd(cdc)
}