Updated on 2026-08-14
This commit is contained in:
parent
febd32b964
commit
ff918c04b4
47 changed files with 440 additions and 1451 deletions
|
|
@ -67,8 +67,8 @@ internal object AccountStatusUseCaseModule {
|
|||
fun provideApplyTokenListSortingUseCaseV2(
|
||||
accountsCRUDRepository: AccountsCRUDRepository,
|
||||
dispatchers: CoroutineDispatcherProvider,
|
||||
): ApplyTokenListSortingUseCaseV2 {
|
||||
return ApplyTokenListSortingUseCaseV2(
|
||||
): ApplyTokenListSortingUseCase {
|
||||
return ApplyTokenListSortingUseCase(
|
||||
accountsCRUDRepository = accountsCRUDRepository,
|
||||
dispatchers = dispatchers,
|
||||
)
|
||||
|
|
@ -141,8 +141,8 @@ internal object AccountStatusUseCaseModule {
|
|||
@Singleton
|
||||
fun provideToggleTokenListSortingUseCaseV2(
|
||||
dispatchers: CoroutineDispatcherProvider,
|
||||
): ToggleTokenListSortingUseCaseV2 {
|
||||
return ToggleTokenListSortingUseCaseV2(
|
||||
): ToggleTokenListSortingUseCase {
|
||||
return ToggleTokenListSortingUseCase(
|
||||
dispatchers = dispatchers,
|
||||
)
|
||||
}
|
||||
|
|
@ -151,8 +151,8 @@ internal object AccountStatusUseCaseModule {
|
|||
@Singleton
|
||||
fun provideToggleTokenListGroupingUseCaseV2(
|
||||
dispatchers: CoroutineDispatcherProvider,
|
||||
): ToggleTokenListGroupingUseCaseV2 {
|
||||
return ToggleTokenListGroupingUseCaseV2(
|
||||
): ToggleTokenListGroupingUseCase {
|
||||
return ToggleTokenListGroupingUseCase(
|
||||
dispatchers = dispatchers,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.tangem.domain.models.account.Account
|
|||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
typealias AccountCryptoCurrencies = Map<Account, List<CryptoCurrency>>
|
||||
typealias AccountCryptoCurrencies = Map<out Account, List<CryptoCurrency>>
|
||||
|
||||
/**
|
||||
* Combines an [Account] with its corresponding [CryptoCurrency].
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ private typealias SortingErrorByAccountId = MutableMap<AccountId, TokenListSorti
|
|||
* @property accountsCRUDRepository Repository for CRUD operations on accounts.
|
||||
* @property dispatchers Coroutine dispatcher provider for managing threading.
|
||||
*/
|
||||
class ApplyTokenListSortingUseCaseV2(
|
||||
class ApplyTokenListSortingUseCase(
|
||||
private val accountsCRUDRepository: AccountsCRUDRepository,
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
) {
|
||||
|
|
@ -131,8 +131,8 @@ class ApplyTokenListSortingUseCaseV2(
|
|||
|
||||
val accountCurrencies = account.cryptoCurrencies.toList()
|
||||
.sortTokens(sortedCurrencies = sortedCurrencies)
|
||||
.getOrElse {
|
||||
errors[account.accountId] = it
|
||||
.getOrElse { error ->
|
||||
errors[account.accountId] = error
|
||||
return@map account
|
||||
}
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
|||
*
|
||||
* @property dispatchers Provides coroutine dispatchers for executing tasks.
|
||||
*/
|
||||
class ToggleTokenListGroupingUseCaseV2(
|
||||
class ToggleTokenListGroupingUseCase(
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
) {
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
|||
*
|
||||
* @property dispatchers Provides coroutine dispatchers for executing tasks.
|
||||
*/
|
||||
class ToggleTokenListSortingUseCaseV2(
|
||||
class ToggleTokenListSortingUseCase(
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
) {
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ internal class ApplyTokenListSortingUseCaseTest {
|
|||
|
||||
private val accountsCRUDRepository = mockk<AccountsCRUDRepository>(relaxUnitFun = true)
|
||||
|
||||
private val useCase = ApplyTokenListSortingUseCaseV2(
|
||||
private val useCase = ApplyTokenListSortingUseCase(
|
||||
accountsCRUDRepository = accountsCRUDRepository,
|
||||
dispatchers = TestingCoroutineDispatcherProvider(),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ import java.math.BigDecimal
|
|||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
class ToggleTokenListGroupingUseCaseV2Test {
|
||||
class ToggleTokenListGroupingUseCaseTest {
|
||||
|
||||
private val useCase = ToggleTokenListGroupingUseCaseV2(dispatchers = TestingCoroutineDispatcherProvider())
|
||||
private val useCase = ToggleTokenListGroupingUseCase(dispatchers = TestingCoroutineDispatcherProvider())
|
||||
|
||||
private val userWalletId = UserWalletId("011")
|
||||
private val cryptoCurrencyFactory = MockCryptoCurrencyFactory()
|
||||
|
|
@ -28,9 +28,9 @@ import java.math.BigDecimal
|
|||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
class ToggleTokenListSortingUseCaseV2Test {
|
||||
class ToggleTokenListSortingUseCaseTest {
|
||||
|
||||
private val useCase = ToggleTokenListSortingUseCaseV2(dispatchers = TestingCoroutineDispatcherProvider())
|
||||
private val useCase = ToggleTokenListSortingUseCase(dispatchers = TestingCoroutineDispatcherProvider())
|
||||
|
||||
private val userWalletId = UserWalletId("011")
|
||||
private val cryptoCurrencyFactory = MockCryptoCurrencyFactory()
|
||||
Loading…
Add table
Add a link
Reference in a new issue