/
codec.go
26 lines (22 loc) · 904 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
package types
import (
"github.com/hbtc-chain/bhchain/codec"
)
// Register concrete types on codec codec
func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(MsgCreateValidator{}, "hbtcchain/MsgCreateValidator", nil)
cdc.RegisterConcrete(MsgEditValidator{}, "hbtcchain/MsgEditValidator", nil)
cdc.RegisterConcrete(MsgKeyNodeHeartbeat{}, "hbtcchain/MsgKeyNodeHeartbeat", nil)
cdc.RegisterConcrete(MsgDelegate{}, "hbtcchain/MsgDelegate", nil)
cdc.RegisterConcrete(MsgUndelegate{}, "hbtcchain/MsgUndelegate", nil)
cdc.RegisterConcrete(MsgBeginRedelegate{}, "hbtcchain/MsgBeginRedelegate", nil)
cdc.RegisterConcrete(&UpdateKeyNodesProposal{}, "hbtcchain/UpdateKeyNodesProposal", nil)
}
// generic sealed codec to be used throughout this module
var ModuleCdc *codec.Codec
func init() {
ModuleCdc = codec.New()
RegisterCodec(ModuleCdc)
codec.RegisterCrypto(ModuleCdc)
ModuleCdc.Seal()
}