private static CallProcessingResult createTransactionProcessingResult(
      final TransactionSimulatorResult simulatorResult, final List<LogWithMetadata> logs) {
    Hash transactionHash = simulatorResult.transaction().getHash();
    List<LogWithMetadata> transactionLogs =
        logs.stream()
            .filter(log -> log.getTransactionHash().equals(transactionHash))
            .collect(Collectors.toList());
    TransactionProcessingResult result = simulatorResult.result();
    return new CallProcessingResult(
        result.isSuccessful() ? 1 : 0,
        result.getOutput(),
        simulatorResult.getGasEstimate(),
        getError(result),
        new LogsResult(transactionLogs));
  }
Constructs a {@link CallProcessingResult} from a transaction simulation result and associated
logs.

@param simulatorResult the result of simulating a single transaction
@param logs a list of logs associated with the transaction
@return a {@link CallProcessingResult} representing the outcome of the transaction simulation
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockStateCallResult.java