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.

36 lines
1019 B

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.RegisterInterface((*Signature)(nil), nil)
  26. cdc.RegisterConcrete(SignatureEd25519{},
  27. "tendermint/SignatureKeyEd25519", nil)
  28. cdc.RegisterConcrete(SignatureSecp256k1{},
  29. "tendermint/SignatureKeySecp256k1", nil)
  30. }