Some checks are pending
docker-build-cometbft / vars (push) Waiting to run
docker-build-cometbft / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-cometbft / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-cometbft / merge-images (push) Blocked by required conditions
docker-build-e2e-node / vars (push) Waiting to run
docker-build-e2e-node / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-e2e-node / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-e2e-node / merge-images (push) Blocked by required conditions
44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package core
|
|
|
|
import (
|
|
"context"
|
|
|
|
abci "github.com/cometbft/cometbft/abci/types"
|
|
"github.com/cometbft/cometbft/libs/bytes"
|
|
"github.com/cometbft/cometbft/proxy"
|
|
ctypes "github.com/cometbft/cometbft/rpc/core/types"
|
|
rpctypes "github.com/cometbft/cometbft/rpc/jsonrpc/types"
|
|
)
|
|
|
|
// ABCIQuery queries the application for some information.
|
|
// More: https://docs.cometbft.com/v0.38.x/rpc/#/ABCI/abci_query
|
|
func (env *Environment) ABCIQuery(
|
|
_ *rpctypes.Context,
|
|
path string,
|
|
data bytes.HexBytes,
|
|
height int64,
|
|
prove bool,
|
|
) (*ctypes.ResultABCIQuery, error) {
|
|
resQuery, err := env.ProxyAppQuery.Query(context.TODO(), &abci.RequestQuery{
|
|
Path: path,
|
|
Data: data,
|
|
Height: height,
|
|
Prove: prove,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &ctypes.ResultABCIQuery{Response: *resQuery}, nil
|
|
}
|
|
|
|
// ABCIInfo gets some info about the application.
|
|
// More: https://docs.cometbft.com/v0.38.x/rpc/#/ABCI/abci_info
|
|
func (env *Environment) ABCIInfo(_ *rpctypes.Context) (*ctypes.ResultABCIInfo, error) {
|
|
resInfo, err := env.ProxyAppQuery.Info(context.TODO(), proxy.RequestInfo)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &ctypes.ResultABCIInfo{Response: *resInfo}, nil
|
|
}
|