private Trace generateTrace() {
    parentTraces.add(rootVmTrace);
    if (transactionTrace != null && !transactionTrace.getTraceFrames().isEmpty()) {
      transactionTrace
          .getTransaction()
          .getInit()
          .map(Bytes::toHexString)
          .ifPresent(rootVmTrace::setCode);
      final Iterator<TraceFrame> iter = transactionTrace.getTraceFrames().iterator();
      Optional<TraceFrame> nextTraceFrame =
          iter.hasNext() ? Optional.of(iter.next()) : Optional.empty();
      while (nextTraceFrame.isPresent()) {
        final TraceFrame traceFrame = nextTraceFrame.get();
        nextTraceFrame = iter.hasNext() ? Optional.of(iter.next()) : Optional.empty();
        addFrame(traceFrame, nextTraceFrame);
      }
    }
    return rootVmTrace;
  }
Generate trace representation from the specified transaction trace.

@return a representation of the trace.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/vm/VmTraceGenerator.java