private static void addContractCreationMethodToTrace(
      final TransactionTrace transactionTrace, final FlatTrace.Builder builder) {
    // add creationMethod for create action
    Optional.ofNullable(builder.getType())
        .filter(type -> type.equals("create"))
        .ifPresent(
            __ ->
                builder
                    .getActionBuilder()
                    .creationMethod(
                        transactionTrace.getTraceFrames().stream()
                            .filter(frame -> "CREATE2".equals(frame.getOpcode()))
                            .findFirst()
                            .map(TraceFrame::getOpcode)
                            .orElse("CREATE")
                            .toLowerCase(Locale.US)));
  }
Generates a stream of {@link Trace} from the passed {@link TransactionTrace} and {@link Block}
data with additional Transaction Information added to FlatTrace

@param protocolSchedule the current {@link ProtocolSchedule} to use
@param transactionTrace the {@link TransactionTrace} to use
@param block the {@link Block} to use
@return a stream of generated traces {@link Trace}
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/flat/FlatTraceGenerator.java