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.

38 lines
759 B

  1. package state
  2. import (
  3. . "github.com/tendermint/tendermint/binary"
  4. . "github.com/tendermint/tendermint/blocks"
  5. "io"
  6. )
  7. // NOTE: consensus/Validator embeds this, so..
  8. type Account struct {
  9. Id uint64 // Numeric id of account, incrementing.
  10. PubKey []byte
  11. }
  12. func ReadAccount(r io.Reader, n *int64, err *error) *Account {
  13. return &Account{
  14. Id: ReadUInt64(r, n, err),
  15. PubKey: ReadByteSlice(r, n, err),
  16. }
  17. }
  18. func (self *Account) Verify(msg []byte, sig Signature) bool {
  19. if sig.SignerId != self.Id {
  20. return false
  21. }
  22. return false
  23. }
  24. //-----------------------------------------------------------------------------
  25. type PrivAccount struct {
  26. Account
  27. PrivKey []byte
  28. }
  29. func (self *PrivAccount) Sign(msg []byte) Signature {
  30. return Signature{}
  31. }