Updated on 2026-08-14
This commit is contained in:
parent
8b75e37e30
commit
a9bca131c3
386 changed files with 1369 additions and 1347 deletions
|
|
@ -43,7 +43,6 @@ dependencies {
|
|||
implementation(projects.libs.blockchainSdk)
|
||||
implementation(deps.androidx.datastore)
|
||||
implementation(deps.arrow.core)
|
||||
implementation(deps.timber)
|
||||
|
||||
/** Testing libraries */
|
||||
testRuntimeOnly(deps.test.junit5.engine)
|
||||
|
|
|
|||
|
|
@ -49,11 +49,11 @@ import com.tangem.domain.walletmanager.model.TokenInfo
|
|||
import com.tangem.domain.walletmanager.utils.SdkPageConverter
|
||||
import com.tangem.domain.wallets.extension.hasDerivation
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.coroutines.withContext
|
||||
import timber.log.Timber
|
||||
import java.math.BigDecimal
|
||||
import java.util.EnumSet
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
|
@ -178,13 +178,13 @@ internal class DefaultWalletManagersFacade @Inject constructor(
|
|||
if (derivationPath != null &&
|
||||
!userWallet.hasDerivation(blockchain, derivationPath)
|
||||
) {
|
||||
Timber.w("Derivation missed for: $blockchain")
|
||||
TangemLogger.w("Derivation missed for: $blockchain")
|
||||
return UpdateWalletManagerResult.MissedDerivation
|
||||
}
|
||||
|
||||
val walletManager = getOrCreateWalletManager(userWalletId, blockchain, derivationPath)
|
||||
if (walletManager == null || blockchain == Blockchain.Unknown) {
|
||||
Timber.w("Unable to get a wallet manager for blockchain: $blockchain")
|
||||
TangemLogger.w("Unable to get a wallet manager for blockchain: $blockchain")
|
||||
return UpdateWalletManagerResult.Unreachable()
|
||||
}
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ internal class DefaultWalletManagersFacade @Inject constructor(
|
|||
val gaslessFeeAddresses = try {
|
||||
gaslessTransactionRepository.getGaslessFeeAddresses()
|
||||
} catch (error: Throwable) {
|
||||
Timber.e(error, "Failed to load gasless fee addresses; falling back to empty set")
|
||||
TangemLogger.e("Failed to load gasless fee addresses; falling back to empty set", error)
|
||||
emptySet()
|
||||
}
|
||||
return when (itemsResult) {
|
||||
|
|
@ -311,7 +311,7 @@ internal class DefaultWalletManagersFacade @Inject constructor(
|
|||
extraTokens: Set<CryptoCurrency.Token>,
|
||||
): UpdateWalletManagerResult {
|
||||
if (derivationPath != null && !userWallet.hasDerivation(blockchain, derivationPath)) {
|
||||
Timber.w("Derivation missed for: $blockchain")
|
||||
TangemLogger.w("Derivation missed for: $blockchain")
|
||||
return UpdateWalletManagerResult.MissedDerivation
|
||||
}
|
||||
|
||||
|
|
@ -321,7 +321,7 @@ internal class DefaultWalletManagersFacade @Inject constructor(
|
|||
derivationPath = derivationPath,
|
||||
)
|
||||
if (walletManager == null || blockchain == Blockchain.Unknown) {
|
||||
Timber.w("Unable to create or find a wallet manager for blockchain: $blockchain")
|
||||
TangemLogger.w("Unable to create or find a wallet manager for blockchain: $blockchain")
|
||||
return UpdateWalletManagerResult.Unreachable()
|
||||
}
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ internal class DefaultWalletManagersFacade @Inject constructor(
|
|||
amountToCreateAccount = e.amountToCreateAccount,
|
||||
)
|
||||
} catch (e: Throwable) {
|
||||
Timber.w(e, "Unable to update a wallet manager for: ${walletManager.wallet.blockchain}")
|
||||
TangemLogger.w("Unable to update a wallet manager for: ${walletManager.wallet.blockchain}", e)
|
||||
|
||||
resultFactory.getUnreachableResult(walletManager)
|
||||
}
|
||||
|
|
@ -376,7 +376,7 @@ internal class DefaultWalletManagersFacade @Inject constructor(
|
|||
amountToCreateAccount = e.amountToCreateAccount,
|
||||
)
|
||||
} catch (e: Throwable) {
|
||||
Timber.w(e, "Unable to update a wallet manager for: ${walletManager.wallet.blockchain}")
|
||||
TangemLogger.w("Unable to update a wallet manager for: ${walletManager.wallet.blockchain}", e)
|
||||
|
||||
resultFactory.getUnreachableResult(walletManager)
|
||||
}
|
||||
|
|
@ -584,7 +584,7 @@ internal class DefaultWalletManagersFacade @Inject constructor(
|
|||
val walletManager = getOrCreateWalletManager(userWalletId = userWalletId, network = currency.network)
|
||||
|
||||
if (walletManager == null) {
|
||||
Timber.e("Unable to get a wallet manager for blockchain: ${currency.network.id}")
|
||||
TangemLogger.e("Unable to get a wallet manager for blockchain: ${currency.network.id}")
|
||||
return emptyList()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import com.tangem.data.walletmanager.utils.SdkAddressToAddressConverter
|
|||
import com.tangem.data.walletmanager.utils.TransactionDataToTxHistoryItemConverter
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.yield.supply.YieldSupplyStatus
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import java.math.BigDecimal
|
||||
|
||||
/** Factory for creating [UpdateWalletManagerResult] */
|
||||
|
|
@ -68,7 +68,7 @@ internal class UpdateWalletManagerResultFactory {
|
|||
val amount = amountToCreateAccount ?: blockchain.amountToCreateAccount(walletManager, firstWalletToken)
|
||||
|
||||
return if (amount == null) {
|
||||
Timber.w("Unable to get required amount to create account for: $blockchain")
|
||||
TangemLogger.w("Unable to get required amount to create account for: $blockchain")
|
||||
UpdateWalletManagerResult.Unreachable(
|
||||
selectedAddress = wallet.address,
|
||||
addresses = getAvailableAddresses(wallet.addresses),
|
||||
|
|
@ -142,7 +142,7 @@ internal class UpdateWalletManagerResultFactory {
|
|||
val value = amount.value
|
||||
|
||||
if (value == null) {
|
||||
Timber.w("Currency amount must not be null: ${amount.currencySymbol}")
|
||||
TangemLogger.w("Currency amount must not be null: ${amount.currencySymbol}")
|
||||
}
|
||||
|
||||
return value
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ import com.tangem.blockchainsdk.BlockchainSDKFactory
|
|||
import com.tangem.crypto.hdWallet.DerivationPath
|
||||
import com.tangem.data.walletmanager.extensions.makePublicKey
|
||||
import com.tangem.data.walletmanager.extensions.makeWalletManagerForApp
|
||||
import com.tangem.domain.wallets.derivations.DerivationStyleProvider
|
||||
import com.tangem.domain.models.scan.ScanResponse
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.wallets.config.curvesConfig
|
||||
import com.tangem.domain.wallets.derivations.DerivationStyleProvider
|
||||
import com.tangem.domain.wallets.derivations.derivationStyleProvider
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
|
||||
internal class WalletManagerFactory(
|
||||
private val blockchainSDKFactory: BlockchainSDKFactory,
|
||||
|
|
@ -32,7 +32,7 @@ internal class WalletManagerFactory(
|
|||
derivationParams = derivationParams,
|
||||
)
|
||||
} catch (e: Throwable) {
|
||||
Timber.w(e, "Failed to create wallet manager for $blockchain")
|
||||
TangemLogger.w("Failed to create wallet manager for $blockchain", e)
|
||||
null
|
||||
}
|
||||
}
|
||||
|
|
@ -68,7 +68,7 @@ internal class WalletManagerFactory(
|
|||
)
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
Timber.w(e, "Failed to create wallet manager for $blockchain")
|
||||
TangemLogger.w("Failed to create wallet manager for $blockchain", e)
|
||||
null
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import com.tangem.blockchain.yieldsupply.providers.ethereum.yield.EthereumYieldS
|
|||
import com.tangem.blockchainsdk.models.UpdateWalletManagerResult.Address
|
||||
import com.tangem.domain.models.network.TxInfo
|
||||
import com.tangem.utils.converter.Converter
|
||||
import timber.log.Timber
|
||||
import com.tangem.utils.logging.TangemLogger
|
||||
import java.math.BigDecimal
|
||||
|
||||
/**
|
||||
|
|
@ -55,7 +55,7 @@ internal class TransactionDataToTxHistoryItemConverter(
|
|||
val value = amount.value
|
||||
|
||||
if (value == null) {
|
||||
Timber.w("Transaction amount must not be null: ${amount.currencySymbol}")
|
||||
TangemLogger.w("Transaction amount must not be null: ${amount.currencySymbol}")
|
||||
}
|
||||
|
||||
return when (feePaidCurrency) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue