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

Method pipeThroughQueryBlocks

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

Source from the content-addressed store, hash-verified

31}
32
33func (qe *EvmQueryExecutor) pipeThroughQueryBlocks(
34 ctx context.Context,
35 ups common.Upstream,
36 req *evm.QueryBlocksRequest,
37 onPage func(proto.Message) error,
38) error {
39 client, ok := getGrpcBdsClient(ups)
40 if !ok || client.QueryClient() == nil {
41 return fmt.Errorf("upstream %s does not support query streaming", ups.Id())
42 }
43 qe.logger.Debug().Str("upstreamId", ups.Id()).Msgf("opening QueryBlocks stream to upstream")
44 stream, err := client.QueryClient().QueryBlocks(ctx, req)
45 if err != nil {
46 qe.logger.Debug().Err(err).Str("upstreamId", ups.Id()).Msgf("failed to open QueryBlocks stream")
47 return err
48 }
49 return qe.recvProtoStream(func() (proto.Message, error) { return stream.Recv() }, onPage, "eth_queryBlocks", ups.Id())
50}
51
52func (qe *EvmQueryExecutor) pipeThroughQueryTransactions(
53 ctx context.Context,

Callers 1

queryBlocksMethod · 0.95

Calls 7

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

Tested by

no test coverage detected