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.

78 lines
1.4 KiB

  1. package blocks
  2. import (
  3. "github.com/tendermint/tendermint/merkle"
  4. "io"
  5. )
  6. /* Validation */
  7. type BlockValidation struct {
  8. Votes merkle.Tree
  9. Adjustments merkle.Tree
  10. }
  11. /* Votes */
  12. type Votes struct {
  13. Tree merkle.Tree
  14. }
  15. func NewVotesFromHash(hash []byte) *Votes {
  16. return nil
  17. }
  18. func (self *Votes) GetVote(validator AccountId) *Vote {
  19. return nil
  20. }
  21. func (self *Votes) PutVote(vote *Vote) bool {
  22. return false
  23. }
  24. func (self *Votes) Verify() bool {
  25. return false
  26. }
  27. func (self *Votes) WriteTo(w io.Writer) (n int64, err error) {
  28. return 0, nil
  29. }
  30. /*
  31. The canonical representation of a Vote for signing:
  32. |L|NNN...|h...|HHH...|
  33. L length of network name (1 byte)
  34. N name of network (max 255 bytes)
  35. h height of block, varint encoded (1+ bytes)
  36. H blockhash voted for height h
  37. The wire format of a vote is usually simply a Signature.
  38. The network name, height, and blockhash are omitted because
  39. they are implied from context. When it is not, e.g. evidence
  40. for double-signing, the wire format is:
  41. |h...|HHH...|A...|SSS...|
  42. */
  43. type Vote struct {
  44. Signature
  45. Height uint32
  46. BlockHash []byte
  47. }
  48. /* |h...|HHH...|A...|SSS...| */
  49. func ReadVote(buf []byte, start int) (*Vote, int) {
  50. return nil, 0
  51. }
  52. /* |L|NNN...|h...|HHH...| */
  53. func (self *Vote) WriteTo(w io.Writer) (n int64, err error) {
  54. return 0, nil
  55. }
  56. /* Adjustments */