MCPcopy Create free account
hub / github.com/CPChain/chain / TraceBlockByHash

Method TraceBlockByHash

protocols/cpc/api_tracer.go:373–379  ·  view source on GitHub ↗

TraceBlockByHash returns the structured logs created during the execution of EVM and returns them as a JSON object.

(ctx context.Context, hash common.Hash, config *TraceConfig)

Source from the content-addressed store, hash-verified

371// TraceBlockByHash returns the structured logs created during the execution of
372// EVM and returns them as a JSON object.
373func (api *PrivateDebugAPI) TraceBlockByHash(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error) {
374 block := api.cpc.blockchain.GetBlockByHash(hash)
375 if block == nil {
376 return nil, fmt.Errorf("block #%x not found", hash)
377 }
378 return api.traceBlock(ctx, block, config)
379}
380
381// TraceBlock returns the structured logs created during the execution of EVM
382// and returns them as a JSON object.

Callers

nothing calls this directly

Calls 2

traceBlockMethod · 0.95
GetBlockByHashMethod · 0.65

Tested by

no test coverage detected