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
826 B

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