-
Notifications
You must be signed in to change notification settings - Fork 5
/
module.go
41 lines (35 loc) · 993 Bytes
/
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
package posts
import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/forbole/juno/v5/modules"
"github.com/forbole/juno/v5/node"
"google.golang.org/grpc"
poststypes "github.com/desmos-labs/desmos/v6/x/posts/types"
)
var (
_ modules.Module = &Module{}
_ modules.GenesisModule = &Module{}
_ modules.BlockModule = &Module{}
_ modules.MessageModule = &Module{}
_ modules.PeriodicOperationsModule = &Module{}
)
// Module represents the x/fees module handler
type Module struct {
cdc codec.Codec
db Database
node node.Node
client poststypes.QueryClient
}
// NewModule allows to build a new Module instance
func NewModule(node node.Node, grpcConnection *grpc.ClientConn, cdc codec.Codec, db Database) *Module {
return &Module{
cdc: cdc,
db: db,
node: node,
client: poststypes.NewQueryClient(grpcConnection),
}
}
// Name implements modules.Module
func (m *Module) Name() string {
return "posts"
}