tendermint/rpc/core/abci.go

26 lines
627 B
Go
Raw Normal View History

2016-08-22 13:00:48 -07:00
package core
import (
ctypes "github.com/tendermint/tendermint/rpc/core/types"
)
//-----------------------------------------------------------------------------
2017-01-12 12:53:32 -08:00
func ABCIQuery(query []byte) (*ctypes.ResultABCIQuery, error) {
2016-08-22 13:00:48 -07:00
res := proxyAppQuery.QuerySync(query)
2017-01-12 12:53:32 -08:00
return &ctypes.ResultABCIQuery{res}, nil
2016-08-22 13:00:48 -07:00
}
2017-01-12 12:53:32 -08:00
func ABCIInfo() (*ctypes.ResultABCIInfo, error) {
res, err := proxyAppQuery.InfoSync()
if err != nil {
return nil, err
}
2017-01-12 12:53:32 -08:00
return &ctypes.ResultABCIInfo{
Data: res.Data,
Version: res.Version,
LastBlockHeight: res.LastBlockHeight,
LastBlockAppHash: res.LastBlockAppHash,
}, nil
2016-08-22 13:00:48 -07:00
}