2020-03-25 08:20:36 -07:00
|
|
|
package keyring
|
2018-06-28 17:54:47 -07:00
|
|
|
|
|
|
|
import (
|
2019-06-05 16:26:17 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
2020-06-04 03:38:24 -07:00
|
|
|
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
2020-04-08 02:38:28 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
2018-06-28 17:54:47 -07:00
|
|
|
)
|
|
|
|
|
2019-12-12 13:52:24 -08:00
|
|
|
// CryptoCdc defines the codec required for keys and info
|
2020-08-10 12:41:21 -07:00
|
|
|
var CryptoCdc *codec.LegacyAmino
|
2018-06-28 17:54:47 -07:00
|
|
|
|
|
|
|
func init() {
|
2020-09-07 07:47:12 -07:00
|
|
|
CryptoCdc = codec.NewLegacyAmino()
|
2020-06-04 03:38:24 -07:00
|
|
|
cryptocodec.RegisterCrypto(CryptoCdc)
|
2020-09-07 07:47:12 -07:00
|
|
|
RegisterLegacyAminoCodec(CryptoCdc)
|
2019-12-12 13:52:24 -08:00
|
|
|
CryptoCdc.Seal()
|
|
|
|
}
|
|
|
|
|
2020-09-07 07:47:12 -07:00
|
|
|
// RegisterLegacyAminoCodec registers concrete types and interfaces on the given codec.
|
|
|
|
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
2018-06-28 17:54:47 -07:00
|
|
|
cdc.RegisterInterface((*Info)(nil), nil)
|
2019-02-11 09:02:47 -08:00
|
|
|
cdc.RegisterConcrete(hd.BIP44Params{}, "crypto/keys/hd/BIP44Params", nil)
|
2018-06-28 17:54:47 -07:00
|
|
|
cdc.RegisterConcrete(localInfo{}, "crypto/keys/localInfo", nil)
|
|
|
|
cdc.RegisterConcrete(ledgerInfo{}, "crypto/keys/ledgerInfo", nil)
|
|
|
|
cdc.RegisterConcrete(offlineInfo{}, "crypto/keys/offlineInfo", nil)
|
2019-03-01 13:29:33 -08:00
|
|
|
cdc.RegisterConcrete(multiInfo{}, "crypto/keys/multiInfo", nil)
|
2018-06-28 17:54:47 -07:00
|
|
|
}
|