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.

48 lines
795 B

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. package vm
  2. import (
  3. . "github.com/tendermint/tendermint2/common"
  4. )
  5. const (
  6. defaultDataStackCapacity = 10
  7. )
  8. type Account struct {
  9. Address Word256
  10. Balance uint64
  11. Code []byte
  12. Nonce uint64
  13. StorageRoot Word256
  14. Other interface{} // For holding all other data.
  15. }
  16. type Log struct {
  17. Address Word256
  18. Topics []Word256
  19. Data []byte
  20. Height uint64
  21. }
  22. type AppState interface {
  23. // Accounts
  24. GetAccount(addr Word256) *Account
  25. UpdateAccount(*Account)
  26. RemoveAccount(*Account)
  27. CreateAccount(*Account) *Account
  28. // Storage
  29. GetStorage(Word256, Word256) Word256
  30. SetStorage(Word256, Word256, Word256) // Setting to Zero is deleting.
  31. // Logs
  32. AddLog(*Log)
  33. }
  34. type Params struct {
  35. BlockHeight uint64
  36. BlockHash Word256
  37. BlockTime int64
  38. GasLimit uint64
  39. }