(ctx context.Context, req *evm.QueryTransfersRequest, onPage func(proto.Message) error)
| 174 | } |
| 175 | |
| 176 | func (qe *EvmQueryExecutor) queryTransfers(ctx context.Context, req *evm.QueryTransfersRequest, onPage func(proto.Message) error) error { |
| 177 | ctx, span := common.StartDetailSpan(ctx, "Query.Execute", |
| 178 | trace.WithAttributes(attribute.String("query.method", "eth_queryTransfers")), |
| 179 | ) |
| 180 | defer span.End() |
| 181 | |
| 182 | fromBlock, toBlock, err := qe.resolveQueryBounds(ctx, req.GetFromBlock(), req.GetToBlock(), req.GetOrder(), req.GetCursor()) |
| 183 | if err != nil { |
| 184 | common.SetTraceSpanError(span, err) |
| 185 | return err |
| 186 | } |
| 187 | |
| 188 | span.SetAttributes( |
| 189 | attribute.Int64("query.fromBlock", int64(fromBlock)), |
| 190 | attribute.Int64("query.toBlock", int64(toBlock)), |
| 191 | ) |
| 192 | qe.logger.Debug().Uint64("fromBlock", fromBlock).Uint64("toBlock", toBlock).Msgf("resolved query bounds for eth_queryTransfers") |
| 193 | |
| 194 | handled, err := qe.tryQueryUpstreams(ctx, "eth_queryTransfers", func(ups common.Upstream) error { |
| 195 | return qe.pipeThroughQueryTransfers(ctx, ups, req, onPage) |
| 196 | }) |
| 197 | if handled { |
| 198 | if err != nil { |
| 199 | common.SetTraceSpanError(span, err) |
| 200 | } |
| 201 | return err |
| 202 | } |
| 203 | |
| 204 | qe.logger.Debug().Msgf("no native upstream available, using shim for eth_queryTransfers") |
| 205 | span.SetAttributes(attribute.String("query.path", "shim")) |
| 206 | return qe.shimQueryTransfers(ctx, req, fromBlock, toBlock, onPage) |
| 207 | } |
| 208 | |
| 209 | func (qe *EvmQueryExecutor) tryQueryUpstreams( |
| 210 | ctx context.Context, |
no test coverage detected