queryclient

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCQueryHandler

type GRPCQueryHandler = func(ctx context.Context, req *QueryRequest) (*QueryResponse, error)

GRPCQueryHandler defines a function type which handles mocked ABCI Query requests using gRPC

type QueryHelper

type QueryHelper struct {
	// contains filtered or unexported fields
}

QueryHelper is a test utility for building a query client from a proto interface registry.

func NewQueryHelper

func NewQueryHelper(cdc encoding.Codec) *QueryHelper

func (*QueryHelper) Invoke

func (q *QueryHelper) Invoke(ctx context.Context, method string, args, reply interface{}, _ ...grpc.CallOption) error

Invoke implements the grpc ClientConn.Invoke method

func (*QueryHelper) NewStream

NewStream implements the grpc ClientConn.NewStream method

func (*QueryHelper) RegisterService

func (q *QueryHelper) RegisterService(sd *grpc.ServiceDesc, handler interface{})

RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC service description, handler is an object which implements that gRPC service/

This functions PANICS: - if a protobuf service is registered twice.

func (*QueryHelper) Route

func (q *QueryHelper) Route(path string) GRPCQueryHandler

Route returns the GRPCQueryHandler for a given query route path or nil if not found

type QueryRequest

type QueryRequest struct {
	Data   []byte
	Height int64
}

QueryRequest is a light mock of cometbft abci.QueryRequest.

type QueryResponse

type QueryResponse struct {
	Value  []byte
	Height int64
}

QueryResponse is a light mock of cometbft abci.QueryResponse.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL