You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
806 B

8 years ago
8 years ago
8 years ago
  1. package core
  2. import (
  3. abci "github.com/tendermint/abci/types"
  4. data "github.com/tendermint/go-wire/data"
  5. ctypes "github.com/tendermint/tendermint/rpc/core/types"
  6. )
  7. //-----------------------------------------------------------------------------
  8. func ABCIQuery(path string, data data.Bytes, prove bool) (*ctypes.ResultABCIQuery, error) {
  9. resQuery, err := proxyAppQuery.QuerySync(abci.RequestQuery{
  10. Path: path,
  11. Data: data,
  12. Prove: prove,
  13. })
  14. if err != nil {
  15. return nil, err
  16. }
  17. logger.Info("ABCIQuery", "path", path, "data", data, "result", resQuery)
  18. return &ctypes.ResultABCIQuery{
  19. resQuery.Result(),
  20. }, nil
  21. }
  22. func ABCIInfo() (*ctypes.ResultABCIInfo, error) {
  23. resInfo, err := proxyAppQuery.InfoSync()
  24. if err != nil {
  25. return nil, err
  26. }
  27. return &ctypes.ResultABCIInfo{resInfo}, nil
  28. }