Note (and slightly repair) a misfeature in the demo app.
This commit is contained in:
parent
e4bc54e8f2
commit
5887288cde
|
@ -37,8 +37,10 @@ class TransactionsDataSource: NSObject {
|
|||
case .cleared:
|
||||
let rawTransactions = await synchronizer.transactions
|
||||
for transaction in rawTransactions {
|
||||
let memos = try await synchronizer.getMemos(for: transaction)
|
||||
transactions.append(TransactionDetailModel(transaction: transaction, memos: memos))
|
||||
if transaction.minedHeight != nil {
|
||||
let memos = try await synchronizer.getMemos(for: transaction)
|
||||
transactions.append(TransactionDetailModel(transaction: transaction, memos: memos))
|
||||
}
|
||||
}
|
||||
case .received:
|
||||
let rawTransactions = await synchronizer.receivedTransactions
|
||||
|
|
|
@ -10,6 +10,10 @@ import UIKit
|
|||
import ZcashLightClientKit
|
||||
|
||||
final class TransactionDetailModel {
|
||||
// FIXME: This enumeration does not represent a sensible set of potential transaction states.
|
||||
// A transaction may be both sent from and received by the same wallet, and in either
|
||||
// case this designation is orthogonal with respect to whether the transaction is
|
||||
// in a pending, mined, or expired state.
|
||||
enum Transaction {
|
||||
case sent(ZcashTransaction.Overview)
|
||||
case received(ZcashTransaction.Overview)
|
||||
|
@ -62,7 +66,11 @@ final class TransactionDetailModel {
|
|||
}
|
||||
|
||||
init(transaction: ZcashTransaction.Overview, memos: [Memo]) {
|
||||
self.transaction = .cleared(transaction)
|
||||
if transaction.minedHeight == nil {
|
||||
self.transaction = .pending(transaction)
|
||||
} else {
|
||||
self.transaction = .cleared(transaction)
|
||||
}
|
||||
self.id = transaction.rawID
|
||||
self.minedHeight = transaction.minedHeight
|
||||
self.expiryHeight = transaction.expiryHeight
|
||||
|
|
Loading…
Reference in New Issue