-
Notifications
You must be signed in to change notification settings - Fork 13
/
codec.go
30 lines (26 loc) · 925 Bytes
/
codec.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
package pkg
import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
config2 "github.com/iov-one/iovns/app/config"
)
// ModuleCdc instantiates a new codec for the domain module
var ModuleCdc = codec.New()
func init() {
RegisterCodec(ModuleCdc)
config := sdk.GetConfig()
config.SetCoinType(config2.CoinType)
config.SetFullFundraiserPath(config2.FullFundraiserPath)
config.SetBech32PrefixForAccount(config2.Bech32PrefixAccAddr, config2.Bech32PrefixAccPub)
config.SetBech32PrefixForValidator(config2.Bech32PrefixValAddr, config2.Bech32PrefixValPub)
config.SetBech32PrefixForConsensusNode(config2.Bech32PrefixConsAddr, config2.Bech32PrefixConsPub)
config.Seal()
}
func RegisterCodec(cdc *codec.Codec) {
sdk.RegisterCodec(cdc)
bank.RegisterCodec(cdc)
auth.RegisterCodec(cdc)
codec.RegisterCrypto(cdc)
}