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.

34 lines
737 B

10 years ago
  1. package account
  2. import (
  3. "fmt"
  4. "github.com/tendermint/tendermint/binary"
  5. . "github.com/tendermint/tendermint/common"
  6. )
  7. // Signature is a part of Txs and consensus Votes.
  8. type Signature interface {
  9. IsZero() bool
  10. String() string
  11. }
  12. // Types of Signature implementations
  13. const (
  14. SignatureTypeEd25519 = byte(0x01)
  15. )
  16. // for binary.readReflect
  17. var _ = binary.RegisterInterface(
  18. struct{ Signature }{},
  19. binary.ConcreteType{SignatureEd25519{}, SignatureTypeEd25519},
  20. )
  21. //-------------------------------------
  22. // Implements Signature
  23. type SignatureEd25519 [64]byte
  24. func (sig SignatureEd25519) IsZero() bool { return len(sig) == 0 }
  25. func (sig SignatureEd25519) String() string { return fmt.Sprintf("/%X.../", Fingerprint(sig[:])) }