From fa80ffd55f62174bee322caa6ab3bed60d1ff818 Mon Sep 17 00:00:00 2001 From: Dmitrij Meidus Date: Thu, 29 May 2025 13:50:00 +0300 Subject: [PATCH] [trello.com/c/SL4zLZnb] Small code improvments --- Adamant/Models/BTCRawTransaction.swift | 2 +- .../BtcWalletService+RichMessageProviderWithStatusCheck.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Adamant/Models/BTCRawTransaction.swift b/Adamant/Models/BTCRawTransaction.swift index 01f1c0d32..3eefa4451 100644 --- a/Adamant/Models/BTCRawTransaction.swift +++ b/Adamant/Models/BTCRawTransaction.swift @@ -27,7 +27,7 @@ struct BTCRawTransaction { func asBtcTransaction(_ as: T.Type, for address: String, blockId: String? = nil) -> T { // MARK: Known values - var confirmationsValue: String? = nil + var confirmationsValue: String? var transactionStatus: TransactionStatus = .registered if let confirmations = confirmations { diff --git a/Adamant/Modules/Wallets/Bitcoin/BtcWalletService+RichMessageProviderWithStatusCheck.swift b/Adamant/Modules/Wallets/Bitcoin/BtcWalletService+RichMessageProviderWithStatusCheck.swift index 850a7759c..1dec21c38 100644 --- a/Adamant/Modules/Wallets/Bitcoin/BtcWalletService+RichMessageProviderWithStatusCheck.swift +++ b/Adamant/Modules/Wallets/Bitcoin/BtcWalletService+RichMessageProviderWithStatusCheck.swift @@ -44,8 +44,8 @@ extension BtcWalletService { transaction: CoinTransaction, btcTransaction: BtcTransaction ) async -> TransactionStatus { - // Before we already stored another status in RawBtcTransactionResponse.asBtcTransaction(_:for:height:). - // So we don't need to double check anything here because it is already at least "registered". + // The status was already set in RawBtcTransactionResponse.asBtcTransaction(_:for:height:), + // so there's no need to check again for `.registered` — at this point it's guaranteed to be at least that. guard let status = btcTransaction.transactionStatus else { return .inconsistent(.unknown) }