You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. package crypto
  2. import (
  3. amino "github.com/tendermint/go-amino"
  4. )
  5. var cdc = amino.NewCodec()
  6. func init() {
  7. // NOTE: It's important that there be no conflicts here,
  8. // as that would change the canonical representations,
  9. // and therefore change the address.
  10. // TODO: Add feature to go-amino to ensure that there
  11. // are no conflicts.
  12. RegisterAmino(cdc)
  13. }
  14. func RegisterAmino(cdc *amino.Codec) {
  15. cdc.RegisterInterface((*PubKey)(nil), nil)
  16. cdc.RegisterConcrete(PubKeyEd25519{},
  17. "tendermint/PubKeyEd25519", nil)
  18. cdc.RegisterConcrete(PubKeySecp256k1{},
  19. "tendermint/PubKeySecp256k1", nil)
  20. cdc.RegisterInterface((*PrivKey)(nil), nil)
  21. cdc.RegisterConcrete(PrivKeyEd25519{},
  22. "tendermint/PrivKeyEd25519", nil)
  23. cdc.RegisterConcrete(PrivKeySecp256k1{},
  24. "tendermint/PrivKeySecp256k1", nil)
  25. cdc.RegisterConcrete(PrivKeyLedgerSecp256k1{},
  26. "tendermint/PrivKeyLedgerSecp256k1", nil)
  27. cdc.RegisterInterface((*Signature)(nil), nil)
  28. cdc.RegisterConcrete(SignatureEd25519{},
  29. "tendermint/SignatureKeyEd25519", nil)
  30. cdc.RegisterConcrete(SignatureSecp256k1{},
  31. "tendermint/SignatureKeySecp256k1", nil)
  32. }