Updated on 2026-08-14
This commit is contained in:
parent
e33bd4d849
commit
b98b0f659c
138 changed files with 686 additions and 346 deletions
|
|
@ -89,6 +89,11 @@ internal class DefaultWalletsRepository(
|
|||
private suspend fun fetchSeedPhraseNotificationStatus(userWalletId: UserWalletId) {
|
||||
val userWallet = userWalletsStore.getSyncOrNull(key = userWalletId)
|
||||
|
||||
if (userWallet != null && userWallet !is UserWallet.Cold) {
|
||||
updateNotificationVisibility(id = userWalletId, value = SeedPhraseNotificationsStatus.NOT_NEEDED)
|
||||
return
|
||||
}
|
||||
|
||||
val status = if (userWallet?.isImported == false) {
|
||||
Status.NOT_NEEDED
|
||||
} else {
|
||||
|
|
@ -291,7 +296,7 @@ internal class DefaultWalletsRepository(
|
|||
override suspend fun associateWallets(applicationId: String, wallets: List<UserWallet>) =
|
||||
withContext(dispatchers.io) {
|
||||
val publicKeys = authProvider.getCardsPublicKeys()
|
||||
val walletsBody = wallets.map { userWallet ->
|
||||
val walletsBody = wallets.filterIsInstance<UserWallet.Cold>().map { userWallet ->
|
||||
WalletIdBodyConverter.convert(
|
||||
userWallet = userWallet,
|
||||
publicKeys = publicKeys.filterKeys { userWallet.cardsInWallet.contains(it) },
|
||||
|
|
|
|||
|
|
@ -176,12 +176,12 @@ class DefaultWalletsRepositoryTest {
|
|||
val card2PublicKey = "card2_public_key"
|
||||
|
||||
val userWallets = listOf(
|
||||
mockk<UserWallet> {
|
||||
mockk<UserWallet.Cold> {
|
||||
every { cardsInWallet } returns setOf(card1PublicKey)
|
||||
every { walletId } returns UserWalletId(wallet1Id)
|
||||
every { name } returns "Wallet 1"
|
||||
},
|
||||
mockk<UserWallet> {
|
||||
mockk<UserWallet.Cold> {
|
||||
every { cardsInWallet } returns setOf(card2PublicKey)
|
||||
every { walletId } returns UserWalletId(wallet2Id)
|
||||
every { name } returns "Wallet 2"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class WalletIdBodyConverterTest {
|
|||
// GIVEN
|
||||
val walletId = UserWalletId("1234567890abcdef")
|
||||
val walletName = "Test Wallet"
|
||||
val userWallet = UserWallet(
|
||||
val userWallet = UserWallet.Cold(
|
||||
walletId = walletId,
|
||||
name = walletName,
|
||||
cardsInWallet = setOf("card1", "card2"),
|
||||
|
|
@ -55,7 +55,7 @@ class WalletIdBodyConverterTest {
|
|||
// GIVEN
|
||||
val walletId = UserWalletId("1234567890abcdef")
|
||||
val walletName = "Test Wallet"
|
||||
val userWallet = UserWallet(
|
||||
val userWallet = UserWallet.Cold(
|
||||
walletId = walletId,
|
||||
name = walletName,
|
||||
cardsInWallet = emptySet(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue