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

Method pipeThroughQueryTransfers

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

Source from the content-addressed store, hash-verified

104}
105
106func (qe *EvmQueryExecutor) pipeThroughQueryTransfers(
107 ctx context.Context,
108 ups common.Upstream,
109 req *evm.QueryTransfersRequest,
110 onPage func(proto.Message) error,
111) error {
112 client, ok := getGrpcBdsClient(ups)
113 if !ok || client.QueryClient() == nil {
114 return fmt.Errorf("upstream %s does not support query streaming", ups.Id())
115 }
116 qe.logger.Debug().Str("upstreamId", ups.Id()).Msgf("opening QueryTransfers stream to upstream")
117 stream, err := client.QueryClient().QueryTransfers(ctx, req)
118 if err != nil {
119 return err
120 }
121 return qe.recvProtoStream(func() (proto.Message, error) { return stream.Recv() }, onPage, "eth_queryTransfers", ups.Id())
122}
123
124func (qe *EvmQueryExecutor) recvProtoStream(recv func() (proto.Message, error), onPage func(proto.Message) error, method string, upstreamId string) error {
125 type cursorPage interface {

Callers 1

queryTransfersMethod · 0.95

Calls 7

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

Tested by

no test coverage detected