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.

16 lines
565 B

6 years ago
  1. package types
  2. // Signable is an interface for all signable things.
  3. // It typically removes signatures before serializing.
  4. // SignBytes returns the bytes to be signed
  5. // NOTE: chainIDs are part of the SignBytes but not
  6. // necessarily the object themselves.
  7. // NOTE: Expected to panic if there is an error marshalling.
  8. type Signable interface {
  9. SignBytes(chainID string) []byte
  10. }
  11. // HashSignBytes is a convenience method for getting the hash of the bytes of a signable
  12. func HashSignBytes(chainID string, o Signable) []byte {
  13. return tmHash(o.SignBytes(chainID))
  14. }