TraceBlockByNumber returns the structured logs created during the execution of EVM and returns them as a JSON object.
(ctx context.Context, number rpc.BlockNumber, config *TraceConfig)
| 350 | // TraceBlockByNumber returns the structured logs created during the execution of |
| 351 | // EVM and returns them as a JSON object. |
| 352 | func (api *PrivateDebugAPI) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *TraceConfig) ([]*txTraceResult, error) { |
| 353 | // Fetch the block that we want to trace |
| 354 | var block *types.Block |
| 355 | |
| 356 | switch number { |
| 357 | case rpc.PendingBlockNumber: |
| 358 | block = api.cpc.miner.PendingBlock() |
| 359 | case rpc.LatestBlockNumber: |
| 360 | block = api.cpc.blockchain.CurrentBlock() |
| 361 | default: |
| 362 | block = api.cpc.blockchain.GetBlockByNumber(uint64(number)) |
| 363 | } |
| 364 | // Trace the block if it was found |
| 365 | if block == nil { |
| 366 | return nil, fmt.Errorf("block #%d not found", number) |
| 367 | } |
| 368 | return api.traceBlock(ctx, block, config) |
| 369 | } |
| 370 | |
| 371 | // TraceBlockByHash returns the structured logs created during the execution of |
| 372 | // EVM and returns them as a JSON object. |
nothing calls this directly
no test coverage detected