2015-11-02 07:39:53 -08:00
|
|
|
package types
|
|
|
|
|
|
|
|
type Application interface {
|
|
|
|
|
|
|
|
// Echo a message
|
2015-11-09 16:29:45 -08:00
|
|
|
Echo(message string) string
|
|
|
|
|
|
|
|
// Return application info
|
|
|
|
Info() []string
|
2015-11-02 07:39:53 -08:00
|
|
|
|
2015-11-27 10:14:46 -08:00
|
|
|
// Set application option (e.g. mode=mempool, mode=consensus)
|
|
|
|
SetOption(key string, value string) RetCode
|
|
|
|
|
2016-01-08 16:52:02 -08:00
|
|
|
// Append a tx
|
2015-11-16 15:50:26 -08:00
|
|
|
AppendTx(tx []byte) ([]Event, RetCode)
|
2015-11-02 07:39:53 -08:00
|
|
|
|
2016-01-08 16:52:02 -08:00
|
|
|
// Validate a tx for the mempool
|
|
|
|
CheckTx(tx []byte) RetCode
|
|
|
|
|
2015-11-02 07:39:53 -08:00
|
|
|
// Return the application Merkle root hash
|
|
|
|
GetHash() ([]byte, RetCode)
|
|
|
|
|
|
|
|
// Add event listener
|
|
|
|
AddListener(key string) RetCode
|
|
|
|
|
|
|
|
// Remove event listener
|
|
|
|
RemListener(key string) RetCode
|
2016-01-18 14:37:42 -08:00
|
|
|
|
|
|
|
// Query for state
|
2016-01-22 16:18:35 -08:00
|
|
|
Query(query []byte) ([]byte, RetCode)
|
2015-11-02 07:39:53 -08:00
|
|
|
}
|