Updated on 2026-08-14

This commit is contained in:
Tangem 2025-11-10 17:01:15 +04:00
parent 7c9e533757
commit 1de582a28c
8 changed files with 50 additions and 28 deletions

View file

@ -254,8 +254,13 @@ internal class DefaultWalletsRepository(
override suspend fun createWallet(userWalletId: UserWalletId) {
withContext(dispatchers.io) {
val userWallet = userWalletsStore.getSyncStrict(key = userWalletId)
tangemTechApi.createWallet(
body = OnlyWalletIdBody(userWalletId.stringValue),
body = WalletIdBody(
walletId = userWalletId.stringValue,
name = userWallet.name,
),
)
}
}

View file

@ -8,9 +8,9 @@ import com.tangem.datasource.api.common.AuthProvider
import com.tangem.datasource.api.common.response.ApiResponse
import com.tangem.datasource.api.common.response.ApiResponseError.HttpException
import com.tangem.datasource.api.tangemTech.TangemTechApi
import com.tangem.datasource.api.tangemTech.models.WalletResponse
import com.tangem.datasource.api.tangemTech.models.PromocodeActivationBody
import com.tangem.datasource.api.tangemTech.models.PromocodeActivationResponse
import com.tangem.datasource.api.tangemTech.models.WalletResponse
import com.tangem.datasource.local.preferences.AppPreferencesStore
import com.tangem.datasource.local.preferences.PreferencesKeys
import com.tangem.domain.models.wallet.UserWallet
@ -226,15 +226,17 @@ class DefaultWalletsRepositoryTest {
// THEN
coVerify(exactly = 1) {
tangemTechApi.associateApplicationIdWithWallets(
eq(applicationId),
match { body ->
applicationId = eq(applicationId),
body = match { body ->
body.size == 2 &&
body.any {
it.walletId == wallet1Id && it.cards.any { card -> card.cardPublicKey == "public_key_1" } &&
it.walletId == wallet1Id &&
it.cards!!.any { card -> card.cardPublicKey == "public_key_1" } &&
it.name == "Wallet 1"
} &&
body.any {
it.walletId == wallet2Id && it.cards.any { card -> card.cardPublicKey == "public_key_2" } &&
it.walletId == wallet2Id &&
it.cards!!.any { card -> card.cardPublicKey == "public_key_2" } &&
it.name == "Wallet 2"
}
},