Updated on 2026-08-14
This commit is contained in:
parent
7aef4046c3
commit
9df8eb5ad4
3 changed files with 17 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ package com.tangem.tap.domain.card
|
|||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.blockchain.common.FeePaidCurrency
|
||||
import com.tangem.blockchain.common.Token
|
||||
import com.tangem.blockchainsdk.utils.ExcludedBlockchains
|
||||
import com.tangem.blockchainsdk.utils.toNetworkId
|
||||
import com.tangem.data.common.currency.CryptoCurrencyFactory
|
||||
import com.tangem.data.common.currency.getNetworkDerivationPath
|
||||
|
|
@ -17,7 +18,7 @@ import com.tangem.domain.tokens.model.Network
|
|||
*/
|
||||
internal class CryptoCurrenciesMocks(private val scanResponse: ScanResponse) {
|
||||
|
||||
private val factory = CryptoCurrencyFactory()
|
||||
private val factory = CryptoCurrencyFactory(excludedBlockchains = ExcludedBlockchains())
|
||||
|
||||
val cardano by lazy { listOf(createCoin(blockchain = Blockchain.Cardano)) }
|
||||
val chia by lazy { listOf(element = createCoin(Blockchain.Chia)) }
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.tangem.tap.domain.card
|
|||
|
||||
import android.annotation.SuppressLint
|
||||
import com.google.common.truth.Truth
|
||||
import com.tangem.blockchainsdk.utils.ExcludedBlockchains
|
||||
import com.tangem.common.CompletionResult
|
||||
import com.tangem.datasource.local.userwallet.UserWalletsStore
|
||||
import com.tangem.domain.card.ScanCardException
|
||||
|
|
@ -29,6 +30,7 @@ internal class DefaultDerivationsRepositoryTest {
|
|||
tangemSdkManager = tangemSdkManager,
|
||||
userWalletsStore = userWalletsStore,
|
||||
dispatchers = TestingCoroutineDispatcherProvider(),
|
||||
excludedBlockchains = ExcludedBlockchains(),
|
||||
)
|
||||
|
||||
private val defaultUserWalletId = UserWalletId("011")
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.tangem.blockchainsdk.utils
|
|||
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.core.configtoggle.blockchain.ExcludedBlockchainsManager
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import javax.inject.Inject
|
||||
|
||||
class ExcludedBlockchains @Inject internal constructor(
|
||||
|
|
@ -22,6 +23,18 @@ class ExcludedBlockchains @Inject internal constructor(
|
|||
override val size: Int
|
||||
get() = excludedBlockchains.size
|
||||
|
||||
@TestOnly
|
||||
constructor() : this(
|
||||
excludedBlockchainsManager = object : ExcludedBlockchainsManager {
|
||||
|
||||
override val excludedBlockchainsIds: Set<String> = emptySet()
|
||||
|
||||
override suspend fun init() {
|
||||
/* no-op */
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
override fun contains(element: Blockchain): Boolean = excludedBlockchains.contains(element)
|
||||
|
||||
override fun containsAll(elements: Collection<Blockchain>): Boolean = excludedBlockchains.containsAll(elements)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue