github.com/ari-anchor/sei-tendermint@v0.0.0-20230519144642-dc826b7b56bb/internal/rpc/core/abci.go (about)

     1  package core
     2  
     3  import (
     4  	"context"
     5  
     6  	abci "github.com/ari-anchor/sei-tendermint/abci/types"
     7  	"github.com/ari-anchor/sei-tendermint/internal/proxy"
     8  	"github.com/ari-anchor/sei-tendermint/rpc/coretypes"
     9  )
    10  
    11  // ABCIQuery queries the application for some information.
    12  // More: https://docs.tendermint.com/master/rpc/#/ABCI/abci_query
    13  func (env *Environment) ABCIQuery(ctx context.Context, req *coretypes.RequestABCIQuery) (*coretypes.ResultABCIQuery, error) {
    14  	resQuery, err := env.ProxyApp.Query(ctx, &abci.RequestQuery{
    15  		Path:   req.Path,
    16  		Data:   req.Data,
    17  		Height: int64(req.Height),
    18  		Prove:  req.Prove,
    19  	})
    20  	if err != nil {
    21  		return nil, err
    22  	}
    23  
    24  	return &coretypes.ResultABCIQuery{Response: *resQuery}, nil
    25  }
    26  
    27  // ABCIInfo gets some info about the application.
    28  // More: https://docs.tendermint.com/master/rpc/#/ABCI/abci_info
    29  func (env *Environment) ABCIInfo(ctx context.Context) (*coretypes.ResultABCIInfo, error) {
    30  	resInfo, err := env.ProxyApp.Info(ctx, &proxy.RequestInfo)
    31  	if err != nil {
    32  		return nil, err
    33  	}
    34  
    35  	return &coretypes.ResultABCIInfo{Response: *resInfo}, nil
    36  }