(ctx context.Context, blockNum uint64, fullTx bool)
| 293 | } |
| 294 | |
| 295 | func (qe *EvmQueryExecutor) fetchBlockViaForward(ctx context.Context, blockNum uint64, fullTx bool) (*evm.BlockHeader, []*evm.Transaction, error) { |
| 296 | params := []interface{}{fmt.Sprintf("0x%x", blockNum), fullTx} |
| 297 | result, err := qe.forwardSubrequest(ctx, "eth_getBlockByNumber", params) |
| 298 | if err != nil { |
| 299 | if common.HasErrorCode(err, common.ErrCodeEndpointMissingData) { |
| 300 | return nil, nil, nil |
| 301 | } |
| 302 | return nil, nil, err |
| 303 | } |
| 304 | if string(result) == "null" { |
| 305 | return nil, nil, nil |
| 306 | } |
| 307 | var block evm.JsonRpcBlock |
| 308 | if err := sonic.Unmarshal(result, &block); err != nil { |
| 309 | return nil, nil, err |
| 310 | } |
| 311 | protoBlock, err := block.ToProto() |
| 312 | if err != nil { |
| 313 | return nil, nil, err |
| 314 | } |
| 315 | return protoBlock.Header, protoBlock.FullTransactions, nil |
| 316 | } |
| 317 | |
| 318 | func (qe *EvmQueryExecutor) fetchLogsViaForward(ctx context.Context, fromBlock, toBlock uint64, filter *evm.LogFilter) ([]*evm.Log, error) { |
| 319 | payload := map[string]interface{}{ |
no test coverage detected