mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 13:55:17 +00:00
This change has two main effects: 1. Remove most of the Async methods from the abci.Client interface. Remaining are FlushAsync, CommitTxAsync, and DeliverTxAsync. 2. Rename the synchronous methods to remove the "Sync" suffix. The rest of the change is updating the implementations, subsets, and mocks of the interface, along with the call sites that point to them. * Fix stringly-typed mock stubs. * Rename helper method.
44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
package core
|
|
|
|
import (
|
|
"context"
|
|
|
|
abci "github.com/tendermint/tendermint/abci/types"
|
|
"github.com/tendermint/tendermint/internal/proxy"
|
|
"github.com/tendermint/tendermint/libs/bytes"
|
|
"github.com/tendermint/tendermint/rpc/coretypes"
|
|
)
|
|
|
|
// ABCIQuery queries the application for some information.
|
|
// More: https://docs.tendermint.com/master/rpc/#/ABCI/abci_query
|
|
func (env *Environment) ABCIQuery(
|
|
ctx context.Context,
|
|
path string,
|
|
data bytes.HexBytes,
|
|
height int64,
|
|
prove bool,
|
|
) (*coretypes.ResultABCIQuery, error) {
|
|
resQuery, err := env.ProxyAppQuery.Query(ctx, abci.RequestQuery{
|
|
Path: path,
|
|
Data: data,
|
|
Height: height,
|
|
Prove: prove,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &coretypes.ResultABCIQuery{Response: *resQuery}, nil
|
|
}
|
|
|
|
// ABCIInfo gets some info about the application.
|
|
// More: https://docs.tendermint.com/master/rpc/#/ABCI/abci_info
|
|
func (env *Environment) ABCIInfo(ctx context.Context) (*coretypes.ResultABCIInfo, error) {
|
|
resInfo, err := env.ProxyAppQuery.Info(ctx, proxy.RequestInfo)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &coretypes.ResultABCIInfo{Response: *resInfo}, nil
|
|
}
|