-
Notifications
You must be signed in to change notification settings - Fork 199
/
module.go
68 lines (51 loc) · 1.78 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
package fixationstore
import (
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/lavanet/lava/x/fixationstore/client/cli"
"github.com/lavanet/lava/x/fixationstore/keeper"
"github.com/lavanet/lava/x/fixationstore/types"
"github.com/spf13/cobra"
)
var (
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModule = AppModule{}
)
const (
ConsensusVersion = 1
)
// AppModuleBasic implements the module.AppModuleBasic interface for the downtime module.
type AppModuleBasic struct{}
func (a AppModuleBasic) Name() string {
return types.MODULE_NAME
}
func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {}
func (a AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry) {}
func (a AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) {}
func (a AppModuleBasic) GetTxCmd() *cobra.Command { return nil }
func (a AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd("")
}
// ---- AppModule
func NewAppModule(k *keeper.Keeper) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{},
k: k,
}
}
type AppModule struct {
AppModuleBasic
k *keeper.Keeper
}
func (a AppModule) ConsensusVersion() uint64 { return ConsensusVersion }
func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {}
// RegisterServices registers a GRPC query service to respond to the
// module-specific GRPC queries.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterQueryServer(cfg.QueryServer(), am.k)
}