<commit_before>//
//  Wallet+ViewModels.swift
//  breadwallet
//
//  Created by <NAME> on 2017-01-12.
//  Copyright © 2017 breadwallet LLC. All rights reserved.
//

import Foundation
import BRCore

extension BRWallet {
    func makeTransactionViewModels(blockHeight: UInt32) -> [Transaction] {
        return transactions.flatMap{ $0 }.sorted{ $0.pointee.timestamp > $1.pointee.timestamp }.map {
            return Transaction($0, wallet: self, blockHeight: blockHeight)
        }
    }
}<commit_msg>Move transactions with 0 timestamp to top of list<commit_after>//
//  Wallet+ViewModels.swift
//  breadwallet
//
//  Created by <NAME> on 2017-01-12.
//  Copyright © 2017 breadwallet LLC. All rights reserved.
//

import Foundation
import BRCore

extension BRWallet {
    func makeTransactionViewModels(blockHeight: UInt32) -> [Transaction] {
        return transactions.flatMap{ $0 }.sorted {
                if $0.pointee.timestamp == 0 {
                    return true
                } else {
                    return $0.pointee.timestamp > $1.pointee.timestamp
                }
            }.map {
                return Transaction($0, wallet: self, blockHeight: blockHeight)
            }
    }
}
{'fraction_non_alphanumeric': 0.11028192371475953, 'fraction_numerical': 0.03233830845771144, 'mean_word_length': 2.2101063829787235, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4540333', 'n_tokens_mistral': 376, 'n_tokens_neox': 347, 'n_words': 93}