2016-08-22 16:00:48 -04:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2017-01-28 08:27:13 -08:00
|
|
|
abci "github.com/tendermint/abci/types"
|
2017-04-21 18:13:25 -04:00
|
|
|
data "github.com/tendermint/go-wire/data"
|
2017-04-26 19:57:33 -04:00
|
|
|
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
2016-08-22 16:00:48 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2017-03-22 20:13:18 +01:00
|
|
|
func ABCIQuery(path string, data data.Bytes, prove bool) (*ctypes.ResultABCIQuery, error) {
|
2017-01-28 08:27:13 -08:00
|
|
|
resQuery, err := proxyAppQuery.QuerySync(abci.RequestQuery{
|
|
|
|
Path: path,
|
|
|
|
Data: data,
|
|
|
|
Prove: prove,
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2017-05-02 11:53:32 +04:00
|
|
|
logger.Info("ABCIQuery", "path", path, "data", data, "result", resQuery)
|
2017-04-27 19:34:25 -04:00
|
|
|
return &ctypes.ResultABCIQuery{
|
2017-04-27 19:51:18 -04:00
|
|
|
resQuery.Result(),
|
2017-04-27 19:34:25 -04:00
|
|
|
}, nil
|
2016-08-22 16:00:48 -04:00
|
|
|
}
|
|
|
|
|
2017-01-12 15:53:32 -05:00
|
|
|
func ABCIInfo() (*ctypes.ResultABCIInfo, error) {
|
2017-01-28 08:27:13 -08:00
|
|
|
resInfo, err := proxyAppQuery.InfoSync()
|
2017-01-12 15:13:47 -05:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2017-01-28 08:27:13 -08:00
|
|
|
return &ctypes.ResultABCIInfo{resInfo}, nil
|
2016-08-22 16:00:48 -04:00
|
|
|
}
|