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

Method queryTransactions

erpc/query_executor.go:77–108  ·  view source on GitHub ↗
(ctx context.Context, req *evm.QueryTransactionsRequest, onPage func(proto.Message) error)

Source from the content-addressed store, hash-verified

75}
76
77func (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
110func (qe *EvmQueryExecutor) queryLogs(ctx context.Context, req *evm.QueryLogsRequest, onPage func(proto.Message) error) error {
111 ctx, span := common.StartDetailSpan(ctx, "Query.Execute",

Callers 1

ExecuteMethod · 0.95

Calls 11

resolveQueryBoundsMethod · 0.95
tryQueryUpstreamsMethod · 0.95
shimQueryTransactionsMethod · 0.95
StartDetailSpanFunction · 0.92
SetTraceSpanErrorFunction · 0.92
EndMethod · 0.80
GetFromBlockMethod · 0.80
GetToBlockMethod · 0.80
SetAttributesMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected