-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathmodule.go
72 lines (59 loc) · 2.84 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
package appmodule
import (
"context"
appmodulev2 "cosmossdk.io/core/appmodule/v2"
"cosmossdk.io/core/registry"
)
// AppModule is a tag interface for app module implementations to use as a basis
// for extension interfaces. It provides no functionality itself, but is the
// type that all valid app modules should provide so that they can be identified
// by other modules (usually via depinject) as app modules.
type AppModule = appmodulev2.AppModule
// HasPreBlocker is the extension interface that modules should implement to run
// custom logic before BeginBlock.
type HasPreBlocker = appmodulev2.HasPreBlocker
// HasBeginBlocker is the extension interface that modules should implement to run
// custom logic before transaction processing in a block.
type HasBeginBlocker = appmodulev2.HasBeginBlocker
// HasEndBlocker is the extension interface that modules should implement to run
// custom logic after transaction processing in a block.
type HasEndBlocker = appmodulev2.HasEndBlocker
// HasRegisterInterfaces is the interface for modules to register their msg types.
type HasRegisterInterfaces = appmodulev2.HasRegisterInterfaces
// ValidatorUpdate defines a validator update.
type ValidatorUpdate = appmodulev2.ValidatorUpdate
// HasServices is the extension interface that modules should implement to register
// implementations of services defined in .proto files.
// This API is supported by the Cosmos SDK module managers but is excluded from core to limit dependencies.
// type HasServices interface {
// AppModule
// // RegisterServices registers the module's services with the app's service
// // registrar.
// //
// // Two types of services are currently supported:
// // - read-only gRPC query services, which are the default.
// // - transaction message services, which must have the protobuf service
// // option "cosmos.msg.v1.service" (defined in "cosmos/msg/v1/service.proto")
// // set to true.
// //
// // The service registrar will figure out which type of service you are
// // implementing based on the presence (or absence) of protobuf options. You
// // do not need to specify this in golang code.
// RegisterServices(grpc.ServiceRegistrar) error
// }
// HasPrepareCheckState is an extension interface that contains information about the AppModule
// and PrepareCheckState.
type HasPrepareCheckState interface {
appmodulev2.AppModule
PrepareCheckState(context.Context) error
}
// HasPrecommit is an extension interface that contains information about the appmodule.AppModule and Precommit.
type HasPrecommit interface {
appmodulev2.AppModule
Precommit(context.Context) error
}
// HasAminoCodec is an extension interface that module must implement to support JSON encoding and decoding of its types
// through amino. This is used in genesis & the CLI client.
type HasAminoCodec interface {
RegisterLegacyAminoCodec(registry.AminoRegistrar)
}