-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.go
33 lines (24 loc) · 819 Bytes
/
app.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
package app
import (
"github.com/cosmos/cosmos-sdk/x/auth" // auth module cosmos sdk
"github.com/tendermint/tendermint/libs/log" // tendermint logging
bam "github.com/cosmos/cosmos-sdk/baseapp"
dbm "github.com/tendermint/tendermint/libs/db" // code for working with tendermint base
)
const (
appName = "nameservice"
)
type nameServiceApp struct {
*bam.BaseApp
}
func NewNameServiceApp(logger log.Logger, db dbm.DB) *nameServiceApp {
// First define the top level codec that will be shared by the different modules. Note: Codec will be explained later
cdc := MakeCodec()
// BaseApp handles interactions with Tendermint through the ABCI protocol
bApp := bam.NewBaseApp(appName, logger, db, auth.DefaultTxDecoder(cdc))
var app = &nameServiceApp{
BaseApp: bApp,
cdc: cdc,
}
return app
}