28 lines
934 B
Go
28 lines
934 B
Go
package keyring
|
|
|
|
import (
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
|
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
|
)
|
|
|
|
// CryptoCdc defines the codec required for keys and info
|
|
var CryptoCdc *codec.LegacyAmino
|
|
|
|
func init() {
|
|
CryptoCdc = codec.NewLegacyAmino()
|
|
cryptocodec.RegisterCrypto(CryptoCdc)
|
|
RegisterLegacyAminoCodec(CryptoCdc)
|
|
CryptoCdc.Seal()
|
|
}
|
|
|
|
// RegisterLegacyAminoCodec registers concrete types and interfaces on the given codec.
|
|
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
|
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)
|
|
}
|