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

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. package types
  2. // Applications
  3. type Application interface {
  4. // Return application info
  5. Info() (info string)
  6. // Set application option (e.g. mode=mempool, mode=consensus)
  7. SetOption(key string, value string) (log string)
  8. // Append a tx
  9. AppendTx(tx []byte) Result
  10. // Validate a tx for the mempool
  11. CheckTx(tx []byte) Result
  12. // Return the application Merkle root hash
  13. Commit() Result
  14. // Query for state
  15. Query(query []byte) Result
  16. }
  17. // Some applications can choose to implement BlockchainAware
  18. type BlockchainAware interface {
  19. // Initialize blockchain
  20. // validators: genesis validators from TendermintCore
  21. InitChain(validators []*Validator)
  22. // Signals the beginning of a block
  23. BeginBlock(height uint64)
  24. // Signals the end of a block
  25. // validators: changed validators from app to TendermintCore
  26. EndBlock(height uint64) (validators []*Validator)
  27. }