-
Notifications
You must be signed in to change notification settings - Fork 182
/
codec.go
28 lines (23 loc) · 922 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
package keys
import (
cryptoAmino "github.com/okex/exchain/libs/tendermint/crypto/encoding/amino"
"github.com/okex/exchain/libs/cosmos-sdk/codec"
"github.com/okex/exchain/libs/cosmos-sdk/crypto/keys/hd"
)
// CryptoCdc defines the codec required for keys and info
var CryptoCdc *codec.Codec
func init() {
CryptoCdc = codec.New()
cryptoAmino.RegisterAmino(CryptoCdc)
RegisterCodec(CryptoCdc)
CryptoCdc.Seal()
}
// RegisterCodec registers concrete types and interfaces on the given codec.
func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterInterface((*Info)(nil), nil)
cdc.RegisterConcrete(hd.BIP44Params{}, "crypto/keys/hd/BIP44Params", nil)
cdc.RegisterConcrete(localInfo{}, "crypto/keys/localInfo", nil)
cdc.RegisterConcrete(ledgerInfo{}, "crypto/keys/ledgerInfo", nil)
cdc.RegisterConcrete(offlineInfo{}, "crypto/keys/offlineInfo", nil)
cdc.RegisterConcrete(multiInfo{}, "crypto/keys/multiInfo", nil)
}