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
754 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. }
  10. // Types of Signature implementations
  11. const (
  12. SignatureTypeEd25519 = byte(0x01)
  13. )
  14. // for binary.readReflect
  15. var _ = binary.RegisterInterface(
  16. struct{ Signature }{},
  17. binary.ConcreteType{SignatureEd25519{}, SignatureTypeEd25519},
  18. )
  19. //-------------------------------------
  20. // Implements Signature
  21. type SignatureEd25519 []byte
  22. func (sig SignatureEd25519) IsNil() bool { return false }
  23. func (sig SignatureEd25519) IsZero() bool { return len(sig) == 0 }
  24. func (sig SignatureEd25519) String() string { return fmt.Sprintf("%X", Fingerprint(sig)) }