Updated on 2026-08-14
This commit is contained in:
parent
37e2f90199
commit
a610e8bf01
2 changed files with 15 additions and 15 deletions
|
|
@ -67,9 +67,9 @@ dependencies {
|
|||
implementation 'com.google.android.material:material:1.2.1'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
|
||||
|
||||
implementation 'com.tangem:blockchain:1.74.0'
|
||||
implementation 'com.tangem:core:1.63.0'
|
||||
implementation 'com.tangem:sdk:1.63.0'
|
||||
implementation 'com.tangem:blockchain:1.76.0'
|
||||
implementation 'com.tangem:core:1.64.0'
|
||||
implementation 'com.tangem:sdk:1.64.0'
|
||||
|
||||
//lifecycle
|
||||
implementation "androidx.lifecycle:lifecycle-runtime:2.2.0"
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@ package com.tangem.tap.features.wallet.redux
|
|||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.tangem.blockchain.common.Amount
|
||||
import com.tangem.blockchain.common.AmountType
|
||||
import com.tangem.blockchain.common.SignatureCountValidator
|
||||
import com.tangem.blockchain.common.Wallet
|
||||
import com.tangem.blockchain.common.*
|
||||
import com.tangem.blockchain.extensions.SimpleResult
|
||||
import com.tangem.commands.Card
|
||||
import com.tangem.commands.common.network.Result
|
||||
|
|
@ -218,22 +215,25 @@ private fun checkIfWarningNeeded(
|
|||
|
||||
private fun checkHashesCountOnline() {
|
||||
if (store.state.walletState.hashesCountVerified != false) return
|
||||
|
||||
if (!NetworkConnectivity.getInstance().isOnlineOrConnecting()) return
|
||||
|
||||
val card = store.state.globalState.scanNoteResponse?.card
|
||||
if (card == null || preferencesStorage.wasCardScannedBefore(card.cardId)) return
|
||||
|
||||
val validator = store.state.globalState.scanNoteResponse?.walletManager
|
||||
as? SignatureCountValidator
|
||||
|
||||
scope.launch {
|
||||
val result = validator?.validateSignatureCount(card?.walletSignedHashes
|
||||
?: 0)
|
||||
val result = validator?.validateSignatureCount(card.walletSignedHashes ?: 0)
|
||||
withContext(Dispatchers.Main) {
|
||||
when (result) {
|
||||
SimpleResult.Success -> store.dispatch(WalletAction.ConfirmHashesCount)
|
||||
is SimpleResult.Failure -> store.dispatch(
|
||||
WalletAction.ShowWarning(WarningType.CardSignedHashesBefore)
|
||||
)
|
||||
SimpleResult.Success -> {
|
||||
store.dispatch(WalletAction.ConfirmHashesCount)
|
||||
store.dispatch(WalletAction.SaveCardId)
|
||||
}
|
||||
is SimpleResult.Failure ->
|
||||
if (result.error is BlockchainSdkError.SignatureCountNotMatched) {
|
||||
store.dispatch(WalletAction.ShowWarning(WarningType.CardSignedHashesBefore))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue