Updated on 2026-08-14

This commit is contained in:
Tangem 2025-11-26 11:57:04 +04:00
parent b283f87b1b
commit bf7c1f2f62
13 changed files with 25 additions and 72 deletions

View file

@ -1,8 +0,0 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues/>
<CurrentIssues>
<ID>CastNullableToNonNullableType:MockScanResponseFactory.kt$MockScanResponseFactory$as</ID>
<ID>MultilineLambdaItParameter:MockScanResponseFactory.kt$MockScanResponseFactory${ CardDTO.Wallet( CardWallet( publicKey = it.name.toByteArray(), // IMPORTANT: public key must equal to curve name chainCode = null, curve = it, settings = createSettings(), totalSignedHashes = null, remainingSignatures = null, index = 0, isImported = true, hasBackup = true, derivedKeys = emptyMap(), ), ) }</ID>
</CurrentIssues>
</SmellBaseline>

View file

@ -2,11 +2,7 @@ package com.tangem.common.test.domain.card
import com.tangem.common.card.CardWallet
import com.tangem.common.card.FirmwareVersion
import com.tangem.domain.card.configs.CardConfig
import com.tangem.domain.card.configs.EdSingleCurrencyCardConfig
import com.tangem.domain.card.configs.GenericCardConfig
import com.tangem.domain.card.configs.MultiWalletCardConfig
import com.tangem.domain.card.configs.Wallet2CardConfig
import com.tangem.domain.card.configs.*
import com.tangem.domain.models.scan.CardDTO
import com.tangem.domain.models.scan.KeyWalletPublicKey
import com.tangem.domain.models.scan.ProductType
@ -73,12 +69,12 @@ object MockScanResponseFactory {
isAccessCodeSet = false,
isPasscodeSet = null,
supportedCurves = emptyList(),
wallets = cardConfig.mandatoryCurves.map {
wallets = cardConfig.mandatoryCurves.map { curve ->
CardDTO.Wallet(
CardWallet(
publicKey = it.name.toByteArray(), // IMPORTANT: public key must equal to curve name
publicKey = curve.name.toByteArray(), // IMPORTANT: public key must equal to curve name
chainCode = null,
curve = it,
curve = curve,
settings = createSettings(),
totalSignedHashes = null,
remainingSignatures = null,
@ -106,6 +102,8 @@ object MockScanResponseFactory {
private fun createSettings(): CardWallet.Settings {
val constructor = CardWallet.Settings::class.java.declaredConstructors[0]
constructor.isAccessible = true
return constructor.newInstance(false) as CardWallet.Settings
val instance = constructor.newInstance(false) as? CardWallet.Settings
return requireNotNull(instance)
}
}