/
codec.go
31 lines (27 loc) · 1.39 KB
/
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
31
package types
import (
"github.com/hbtc-chain/bhchain/codec"
)
var ModuleCdc = codec.New()
// Register concrete types on codec codec
func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(&TradingPair{}, "hbtcchain/openswap/TradingPair", nil)
cdc.RegisterConcrete(&AddrLiquidity{}, "hbtcchain/openswap/AddrLiquidity", nil)
cdc.RegisterConcrete(MsgCreateDex{}, "hbtcchain/openswap/MsgCreateDex", nil)
cdc.RegisterConcrete(MsgEditDex{}, "hbtcchain/openswap/MsgEditDex", nil)
cdc.RegisterConcrete(MsgCreateTradingPair{}, "hbtcchain/openswap/MsgCreateTradingPair", nil)
cdc.RegisterConcrete(MsgEditTradingPair{}, "hbtcchain/openswap/MsgEditTradingPair", nil)
cdc.RegisterConcrete(MsgAddLiquidity{}, "hbtcchain/openswap/MsgAddLiquidity", nil)
cdc.RegisterConcrete(MsgRemoveLiquidity{}, "hbtcchain/openswap/MsgRemoveLiquidity", nil)
cdc.RegisterConcrete(MsgSwapExactIn{}, "hbtcchain/openswap/MsgSwapExactIn", nil)
cdc.RegisterConcrete(MsgSwapExactOut{}, "hbtcchain/openswap/MsgSwapExactOut", nil)
cdc.RegisterConcrete(MsgLimitSwap{}, "hbtcchain/openswap/MsgLimitSwap", nil)
cdc.RegisterConcrete(MsgCancelLimitSwap{}, "hbtcchain/openswap/MsgCancelLimitSwap", nil)
cdc.RegisterConcrete(MsgClaimEarning{}, "hbtcchain/openswap/MsgClaimEarning", nil)
cdc.RegisterConcrete(&Order{}, "hbtcchain/openswap/Order", nil)
}
func init() {
RegisterCodec(ModuleCdc)
codec.RegisterCrypto(ModuleCdc)
ModuleCdc.Seal()
}