MCPcopy Create free account
hub / github.com/erpc/erpc / pipeThroughQueryTransactions

Method pipeThroughQueryTransactions

erpc/query_pipe_through.go:52–68  ·  view source on GitHub ↗
(
	ctx context.Context,
	ups common.Upstream,
	req *evm.QueryTransactionsRequest,
	onPage func(proto.Message) error,
)

Source from the content-addressed store, hash-verified

50}
51
52func (qe *EvmQueryExecutor) pipeThroughQueryTransactions(
53 ctx context.Context,
54 ups common.Upstream,
55 req *evm.QueryTransactionsRequest,
56 onPage func(proto.Message) error,
57) error {
58 client, ok := getGrpcBdsClient(ups)
59 if !ok || client.QueryClient() == nil {
60 return fmt.Errorf("upstream %s does not support query streaming", ups.Id())
61 }
62 qe.logger.Debug().Str("upstreamId", ups.Id()).Msgf("opening QueryTransactions stream to upstream")
63 stream, err := client.QueryClient().QueryTransactions(ctx, req)
64 if err != nil {
65 return err
66 }
67 return qe.recvProtoStream(func() (proto.Message, error) { return stream.Recv() }, onPage, "eth_queryTransactions", ups.Id())
68}
69
70func (qe *EvmQueryExecutor) pipeThroughQueryLogs(
71 ctx context.Context,

Callers 1

queryTransactionsMethod · 0.95

Calls 7

recvProtoStreamMethod · 0.95
getGrpcBdsClientFunction · 0.85
ErrorfMethod · 0.80
RecvMethod · 0.80
QueryClientMethod · 0.65
IdMethod · 0.65
QueryTransactionsMethod · 0.45

Tested by

no test coverage detected