2018-05-23 22:49:46 -04:00
|
|
|
package types
|
|
|
|
|
|
|
|
import common "github.com/tendermint/tmlibs/common"
|
|
|
|
|
|
|
|
// nondeterministic
|
|
|
|
type ResultException struct {
|
|
|
|
Error string `json:"error,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResultEcho struct {
|
|
|
|
Message string `json:"message,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResultFlush struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResultInfo struct {
|
|
|
|
Data string `json:"data,omitempty"`
|
|
|
|
Version string `json:"version,omitempty"`
|
|
|
|
LastBlockHeight int64 `json:"last_block_height,omitempty"`
|
|
|
|
LastBlockAppHash []byte `json:"last_block_app_hash,omitempty"`
|
|
|
|
}
|
|
|
|
|
2018-05-23 23:27:46 -04:00
|
|
|
func FromResultInfo(res ResultInfo) ResponseInfo {
|
|
|
|
return ResponseInfo(res)
|
|
|
|
}
|
|
|
|
|
2018-05-23 22:49:46 -04:00
|
|
|
type ResultSetOption struct {
|
|
|
|
Code uint32 `json:"code,omitempty"`
|
|
|
|
// bytes data = 2;
|
|
|
|
Log string `json:"log,omitempty"`
|
|
|
|
Info string `json:"info,omitempty"`
|
|
|
|
}
|
|
|
|
|
2018-05-23 23:27:46 -04:00
|
|
|
func FromResultSetOption(res ResultSetOption) ResponseSetOption {
|
|
|
|
return ResponseSetOption(res)
|
|
|
|
}
|
|
|
|
|
2018-05-23 22:49:46 -04:00
|
|
|
type ResultInitChain struct {
|
|
|
|
Validators []Validator `json:"validators"`
|
|
|
|
}
|
|
|
|
|
2018-05-23 23:27:46 -04:00
|
|
|
func FromResultInitChain(res ResultInitChain) ResponseInitChain {
|
|
|
|
return ResponseInitChain(res)
|
|
|
|
}
|
|
|
|
|
2018-05-23 22:49:46 -04:00
|
|
|
type ResultQuery struct {
|
|
|
|
Code uint32 `json:"code,omitempty"`
|
|
|
|
// bytes data = 2; // use "value" instead.
|
|
|
|
Log string `json:"log,omitempty"`
|
|
|
|
Info string `json:"info,omitempty"`
|
|
|
|
Index int64 `json:"index,omitempty"`
|
|
|
|
Key []byte `json:"key,omitempty"`
|
|
|
|
Value []byte `json:"value,omitempty"`
|
|
|
|
Proof []byte `json:"proof,omitempty"`
|
|
|
|
Height int64 `json:"height,omitempty"`
|
|
|
|
}
|
|
|
|
|
2018-05-23 23:27:46 -04:00
|
|
|
func FromResultQuery(res ResultQuery) ResponseQuery {
|
|
|
|
return ResponseQuery(res)
|
|
|
|
}
|
|
|
|
|
2018-05-23 22:49:46 -04:00
|
|
|
type ResultBeginBlock struct {
|
|
|
|
Tags []common.KVPair `json:"tags,omitempty"`
|
|
|
|
}
|
|
|
|
|
2018-05-23 23:27:46 -04:00
|
|
|
func FromResultBeginBlock(res ResultBeginBlock) ResponseBeginBlock {
|
|
|
|
return ResponseBeginBlock(res)
|
|
|
|
}
|
|
|
|
|
2018-05-23 22:49:46 -04:00
|
|
|
type ResultCheckTx struct {
|
|
|
|
Code uint32 `json:"code,omitempty"`
|
|
|
|
Data []byte `json:"data,omitempty"`
|
|
|
|
Log string `json:"log,omitempty"`
|
|
|
|
Info string `json:"info,omitempty"`
|
|
|
|
GasWanted int64 `json:"gas_wanted,omitempty"`
|
|
|
|
GasUsed int64 `json:"gas_used,omitempty"`
|
|
|
|
Tags []common.KVPair `json:"tags,omitempty"`
|
|
|
|
Fee common.KI64Pair `json:"fee"`
|
|
|
|
}
|
|
|
|
|
2018-05-23 23:27:46 -04:00
|
|
|
func FromResultCheckTx(res ResultCheckTx) ResponseCheckTx {
|
|
|
|
return ResponseCheckTx(res)
|
|
|
|
}
|
|
|
|
|
2018-05-23 22:49:46 -04:00
|
|
|
type ResultDeliverTx struct {
|
|
|
|
Code uint32 `json:"code,omitempty"`
|
|
|
|
Data []byte `json:"data,omitempty"`
|
|
|
|
Log string `json:"log,omitempty"`
|
|
|
|
Info string `json:"info,omitempty"`
|
|
|
|
GasWanted int64 `json:"gas_wanted,omitempty"`
|
|
|
|
GasUsed int64 `json:"gas_used,omitempty"`
|
|
|
|
Tags []common.KVPair `json:"tags,omitempty"`
|
|
|
|
Fee common.KI64Pair `json:"fee"`
|
|
|
|
}
|
|
|
|
|
2018-05-23 23:27:46 -04:00
|
|
|
func FromResultDeliverTx(res ResultDeliverTx) ResponseDeliverTx {
|
|
|
|
return ResponseDeliverTx(res)
|
|
|
|
}
|
|
|
|
|
2018-05-23 22:49:46 -04:00
|
|
|
type ResultEndBlock struct {
|
|
|
|
ValidatorUpdates []Validator `json:"validator_updates"`
|
|
|
|
ConsensusParamUpdates *ConsensusParams `json:"consensus_param_updates,omitempty"`
|
|
|
|
Tags []common.KVPair `json:"tags,omitempty"`
|
|
|
|
}
|
|
|
|
|
2018-05-23 23:27:46 -04:00
|
|
|
func FromResultEndBlock(res ResultEndBlock) ResponseEndBlock {
|
|
|
|
return ResponseEndBlock(res)
|
|
|
|
}
|
|
|
|
|
2018-05-23 22:49:46 -04:00
|
|
|
type ResultCommit struct {
|
|
|
|
// reserve 1
|
|
|
|
Data []byte `json:"data,omitempty"`
|
|
|
|
}
|
2018-05-23 23:27:46 -04:00
|
|
|
|
|
|
|
func FromResultCommit(res ResultCommit) ResponseCommit {
|
|
|
|
return ResponseCommit(res)
|
|
|
|
}
|