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.

37 lines
1.1 KiB

  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. // RegisterAmino registers all crypto related types in the given (amino) codec.
  15. func RegisterAmino(cdc *amino.Codec) {
  16. cdc.RegisterInterface((*PubKey)(nil), nil)
  17. cdc.RegisterConcrete(PubKeyEd25519{},
  18. "tendermint/PubKeyEd25519", nil)
  19. cdc.RegisterConcrete(PubKeySecp256k1{},
  20. "tendermint/PubKeySecp256k1", nil)
  21. cdc.RegisterInterface((*PrivKey)(nil), nil)
  22. cdc.RegisterConcrete(PrivKeyEd25519{},
  23. "tendermint/PrivKeyEd25519", nil)
  24. cdc.RegisterConcrete(PrivKeySecp256k1{},
  25. "tendermint/PrivKeySecp256k1", nil)
  26. cdc.RegisterInterface((*Signature)(nil), nil)
  27. cdc.RegisterConcrete(SignatureEd25519{},
  28. "tendermint/SignatureEd25519", nil)
  29. cdc.RegisterConcrete(SignatureSecp256k1{},
  30. "tendermint/SignatureSecp256k1", nil)
  31. }