class DebugTraceBlockByHash implements JsonRpcMethod {

  @Override
  public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
    final Hash blockHash = requestContext.getRequiredParameter(0, Hash.class);
    final TraceOptions traceOptions =
        requestContext
            .getOptionalParameter(1, TransactionTraceParams.class)
            .map(TransactionTraceParams::traceOptions)
            .orElse(TraceOptions.DEFAULT);

    final Collection<DebugTraceTransactionResult> results =
        blockTracerSupplier
            .get()
            .trace(blockHash, new DebugOperationTracer(traceOptions))
            .map(BlockTrace::getTransactionTraces)
            .map(DebugTraceTransactionResult::of)
            .orElse(null);
    return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), results);
  }

  public  DebugTraceBlockByHash(final Supplier<BlockTracer> blockTracerSupplier);

}