/
module.go
42 lines (34 loc) · 902 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
42
package history
import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/forbole/juno/v2/modules"
"github.com/forbole/juno/v2/modules/messages"
"github.com/forbole/juno/v2/types/config"
"github.com/forbole/bdjuno/v2/database"
)
const (
moduleName = "history"
)
var (
_ modules.Module = &Module{}
)
// Module represents the module that allows to store historic information
type Module struct {
cfg config.ChainConfig
cdc codec.Codec
db *database.Db
getAddresses messages.MessageAddressesParser
}
// NewModule allows to build a new Module instance
func NewModule(cfg config.ChainConfig, messagesParser messages.MessageAddressesParser, cdc codec.Codec, db *database.Db) *Module {
return &Module{
cfg: cfg,
cdc: cdc,
db: db,
getAddresses: messagesParser,
}
}
// Name implements modules.Module
func (m *Module) Name() string {
return moduleName
}