(ctx context.Context, req *evm.QueryTransactionsRequest, onPage func(proto.Message) error)
| 75 | } |
| 76 | |
| 77 | func (qe *EvmQueryExecutor) queryTransactions(ctx context.Context, req *evm.QueryTransactionsRequest, onPage func(proto.Message) error) error { |
| 78 | ctx, span := common.StartDetailSpan(ctx, "Query.Execute", |
| 79 | trace.WithAttributes(attribute.String("query.method", "eth_queryTransactions")), |
| 80 | ) |
| 81 | defer span.End() |
| 82 | |
| 83 | fromBlock, toBlock, err := qe.resolveQueryBounds(ctx, req.GetFromBlock(), req.GetToBlock(), req.GetOrder(), req.GetCursor()) |
| 84 | if err != nil { |
| 85 | common.SetTraceSpanError(span, err) |
| 86 | return err |
| 87 | } |
| 88 | |
| 89 | span.SetAttributes( |
| 90 | attribute.Int64("query.fromBlock", int64(fromBlock)), |
| 91 | attribute.Int64("query.toBlock", int64(toBlock)), |
| 92 | ) |
| 93 | qe.logger.Debug().Uint64("fromBlock", fromBlock).Uint64("toBlock", toBlock).Msgf("resolved query bounds for eth_queryTransactions") |
| 94 | |
| 95 | handled, err := qe.tryQueryUpstreams(ctx, "eth_queryTransactions", func(ups common.Upstream) error { |
| 96 | return qe.pipeThroughQueryTransactions(ctx, ups, req, onPage) |
| 97 | }) |
| 98 | if handled { |
| 99 | if err != nil { |
| 100 | common.SetTraceSpanError(span, err) |
| 101 | } |
| 102 | return err |
| 103 | } |
| 104 | |
| 105 | qe.logger.Debug().Msgf("no native upstream available, using shim for eth_queryTransactions") |
| 106 | span.SetAttributes(attribute.String("query.path", "shim")) |
| 107 | return qe.shimQueryTransactions(ctx, req, fromBlock, toBlock, onPage) |
| 108 | } |
| 109 | |
| 110 | func (qe *EvmQueryExecutor) queryLogs(ctx context.Context, req *evm.QueryLogsRequest, onPage func(proto.Message) error) error { |
| 111 | ctx, span := common.StartDetailSpan(ctx, "Query.Execute", |
no test coverage detected