github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/crypto/keys/codec.go (about)

     1  package keys
     2  
     3  import (
     4  	cryptoAmino "github.com/fibonacci-chain/fbc/libs/tendermint/crypto/encoding/amino"
     5  
     6  	"github.com/fibonacci-chain/fbc/libs/cosmos-sdk/codec"
     7  	"github.com/fibonacci-chain/fbc/libs/cosmos-sdk/crypto/keys/hd"
     8  )
     9  
    10  // CryptoCdc defines the codec required for keys and info
    11  var CryptoCdc *codec.Codec
    12  
    13  func init() {
    14  	CryptoCdc = codec.New()
    15  	cryptoAmino.RegisterAmino(CryptoCdc)
    16  	RegisterCodec(CryptoCdc)
    17  	CryptoCdc.Seal()
    18  }
    19  
    20  // RegisterCodec registers concrete types and interfaces on the given codec.
    21  func RegisterCodec(cdc *codec.Codec) {
    22  	cdc.RegisterInterface((*Info)(nil), nil)
    23  	cdc.RegisterConcrete(hd.BIP44Params{}, "crypto/keys/hd/BIP44Params", nil)
    24  	cdc.RegisterConcrete(localInfo{}, "crypto/keys/localInfo", nil)
    25  	cdc.RegisterConcrete(ledgerInfo{}, "crypto/keys/ledgerInfo", nil)
    26  	cdc.RegisterConcrete(offlineInfo{}, "crypto/keys/offlineInfo", nil)
    27  	cdc.RegisterConcrete(multiInfo{}, "crypto/keys/multiInfo", nil)
    28  }