Apply suggestions from code review.

Co-authored-by: str4d <thestr4d@gmail.com>
This commit is contained in:
Kris Nuttycombe 2023-09-19 15:58:27 -06:00
parent 404eff21b1
commit a338e1daf5
2 changed files with 2 additions and 2 deletions

View File

@ -87,10 +87,10 @@ class TransactionSQLDAO: TransactionRepository {
func find(from transaction: ZcashTransaction.Overview, limit: Int, kind: TransactionKind) async throws -> [ZcashTransaction.Overview] {
guard
let transactionIndex = transaction.index,
let transactionBlockHeight = transaction.minedHeight
else { throw ZcashError.transactionRepositoryTransactionMissingRequiredFields }
let transactionIndex = transaction.index ?? Int.max
let query = transactionsView
.order((ZcashTransaction.Overview.Column.minedHeight ?? BlockHeight.max).desc)
.filter(

View File

@ -201,7 +201,7 @@ class TransactionRepositoryTests: XCTestCase {
transactionsFrom.forEach { preceededTransaction in
guard let precedingHeight = preceededTransaction.minedHeight, let transactionHeight = transaction.minedHeight else {
XCTFail("Transactions are missing indexes.")
XCTFail("Transactions are missing mined heights.")
return
}