/
module.go
94 lines (68 loc) · 2.23 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package metaprotocols
import (
"encoding/json"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
abci "github.com/cometbft/cometbft/abci/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"
"github.com/cosmos/gaia/v16/x/metaprotocols/types"
)
const consensusVersion uint64 = 1
var (
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleGenesis = AppModule{}
_ module.AppModule = AppModule{}
)
type AppModuleBasic struct{}
func (a AppModuleBasic) Name() string {
return types.ModuleName
}
// DefaultGenesis is an empty object
func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage {
return []byte("{}")
}
func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, config client.TxEncodingConfig, _ json.RawMessage) error {
return nil
}
func (a AppModule) ExportGenesis(_ sdk.Context, cdc codec.JSONCodec) json.RawMessage {
return a.DefaultGenesis(cdc)
}
func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate {
return nil
}
func (AppModule) ConsensusVersion() uint64 { return consensusVersion }
func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
types.RegisterInterfaces(registry)
}
func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
}
func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
}
func (a AppModuleBasic) GetTxCmd() *cobra.Command {
return nil
}
func (a AppModuleBasic) GetQueryCmd() *cobra.Command {
return nil
}
func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {
}
type AppModule struct {
AppModuleBasic
}
func NewAppModule() *AppModule {
return &AppModule{}
}
func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
}
func (a AppModule) RegisterServices(_ module.Configurator) {
}
func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
}
func (a AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return nil
}