-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodule.go
57 lines (45 loc) · 1.86 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
package mock
import (
"cosmossdk.io/core/appmodule"
"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/datachainlab/ibc-mock-client/modules/light-clients/xx-mock/types"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
)
// ----------------------------------------------------------------------------
// AppModuleBasic
// ----------------------------------------------------------------------------
var (
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ appmodule.AppModule = (*AppModule)(nil)
)
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModule) IsOnePerModuleType() {}
// IsAppModule implements the appmodule.AppModule interface.
func (AppModule) IsAppModule() {}
// AppModuleBasic defines the basic application module used by the mock light client.
// Only the RegisterInterfaces function needs to be implemented. All other function perform
// a no-op.
type AppModuleBasic struct{}
// Name returns the mock module name.
func (AppModuleBasic) Name() string {
return types.ModuleName
}
// RegisterLegacyAminoCodec performs a no-op. The Mock client does not support amino.
func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {}
// RegisterInterfaces registers module concrete types into protobuf Any. This allows core IBC
// to unmarshal mock light client types.
func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
types.RegisterInterfaces(registry)
}
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {}
// AppModule is the application module for the Mock client module
type AppModule struct {
AppModuleBasic
}
// NewAppModule creates a new Mock client module
func NewAppModule() AppModule {
return AppModule{}
}