( ctx context.Context, ups common.Upstream, req *evm.QueryTransfersRequest, onPage func(proto.Message) error, )
| 104 | } |
| 105 | |
| 106 | func (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 | |
| 124 | func (qe *EvmQueryExecutor) recvProtoStream(recv func() (proto.Message, error), onPage func(proto.Message) error, method string, upstreamId string) error { |
| 125 | type cursorPage interface { |
no test coverage detected