mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-04 02:52:07 +00:00
No need to duplicate information in this case. It a) requires extra efforts to keep both in sync b) nobody reads godoc documentation anyways.
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
package core
|
|
|
|
import (
|
|
abci "github.com/tendermint/tendermint/abci/types"
|
|
cmn "github.com/tendermint/tendermint/libs/common"
|
|
"github.com/tendermint/tendermint/proxy"
|
|
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
|
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
|
)
|
|
|
|
// ABCIQuery queries the application for some information.
|
|
// More: https://tendermint.com/rpc/#/ABCI/abci_query
|
|
func ABCIQuery(
|
|
ctx *rpctypes.Context,
|
|
path string,
|
|
data cmn.HexBytes,
|
|
height int64,
|
|
prove bool,
|
|
) (*ctypes.ResultABCIQuery, error) {
|
|
resQuery, err := proxyAppQuery.QuerySync(abci.RequestQuery{
|
|
Path: path,
|
|
Data: data,
|
|
Height: height,
|
|
Prove: prove,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
logger.Info("ABCIQuery", "path", path, "data", data, "result", resQuery)
|
|
return &ctypes.ResultABCIQuery{Response: *resQuery}, nil
|
|
}
|
|
|
|
// ABCIInfo gets some info about the application.
|
|
// More: https://tendermint.com/rpc/#/ABCI/abci_info
|
|
func ABCIInfo(ctx *rpctypes.Context) (*ctypes.ResultABCIInfo, error) {
|
|
resInfo, err := proxyAppQuery.InfoSync(proxy.RequestInfo)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &ctypes.ResultABCIInfo{Response: *resInfo}, nil
|
|
}
|