From 88d86ad882aae7d91d2c02dd5798fa6112fd971d Mon Sep 17 00:00:00 2001 From: arvifox Date: Tue, 30 Jul 2024 15:18:49 +0300 Subject: [PATCH 1/2] reformat --- android-foundation | 2 +- .../common/di/modules/CommonModule.kt | 2 +- .../common/domain/CoroutineManager.kt | 45 ------------------- .../common/domain/DarkThemeManager.kt | 1 + .../data/repository/UserRepositoryImpl.kt | 2 +- .../di/AccountFeatureModule.kt | 2 +- .../data/repository/UserRepositoryTest.kt | 2 +- .../data/AssetsRepositoryImpl.kt | 2 +- .../di/AssetsFeatureModule.kt | 2 +- .../domain/AssetsInteractorImpl.kt | 2 +- .../assetdetails/AssetDetailsViewModel.kt | 2 +- .../receiverequest/QRCodeFlowViewModel.kt | 2 +- .../screens/scan/QrCodeScannerViewModel.kt | 2 +- .../data/AssetsRepositoryTest.kt | 2 +- .../domain/AssetsInteractorTest.kt | 2 +- .../qr/QrCodeFlowViewModelTest.kt | 2 +- .../domain/TransactionHistoryHandlerImpl.kt | 2 +- .../domain/TransactionHistoryHandlerTest.kt | 2 +- .../allcurrencies/AllCurrenciesViewModel.kt | 2 +- .../allpools/AllPoolsViewModel.kt | 2 +- .../presentation/MainViewModel.kt | 2 +- .../presentation/MainViewModelTest.kt | 2 +- .../presentation/OnboardingViewModel.kt | 2 +- .../AccountDetailsViewModel.kt | 2 +- .../OnboardingViewModelTest.kt | 2 +- .../AccountDetailsViewModelTest.kt | 2 +- .../di/PolkaswapFeatureModule.kt | 2 +- .../domain/PoolsUpdateSubscriptionImpl.kt | 2 +- .../liquidityadd/LiquidityAddViewModel.kt | 2 +- .../add/AddLiquidityViewModelTest.kt | 2 +- .../NodeManagerImpl.kt | 2 +- .../di/SelectNodeFeatureModule.kt | 2 +- .../domain/SelectNodeInteractor.kt | 2 +- .../domain/SoraCardInteractorImpl.kt | 2 +- .../cardshub/CardsHubViewModel.kt | 2 +- .../wallet/CardsHubViewModelTest.kt | 2 +- .../sora/substrate/di/SubstrateModule.kt | 2 +- .../sora/substrate/runtime/RuntimeManager.kt | 2 +- .../substrate/substrate/ExtrinsicManager.kt | 2 +- .../substrate/WsConnectionManager.kt | 2 +- 40 files changed, 39 insertions(+), 83 deletions(-) delete mode 100644 common/src/main/java/jp/co/soramitsu/common/domain/CoroutineManager.kt diff --git a/android-foundation b/android-foundation index f6b9d333c..193868497 160000 --- a/android-foundation +++ b/android-foundation @@ -1 +1 @@ -Subproject commit f6b9d333c30adcb41c94720dca256f48aac25d2a +Subproject commit 193868497926d8f7f8e1714d804b4898f34b790e diff --git a/common/src/main/java/jp/co/soramitsu/common/di/modules/CommonModule.kt b/common/src/main/java/jp/co/soramitsu/common/di/modules/CommonModule.kt index 83ccee519..0eeecbf11 100644 --- a/common/src/main/java/jp/co/soramitsu/common/di/modules/CommonModule.kt +++ b/common/src/main/java/jp/co/soramitsu/common/di/modules/CommonModule.kt @@ -52,6 +52,7 @@ import java.security.SecureRandom import java.util.Locale import java.util.TimeZone import javax.inject.Singleton +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.phone.BasicClipboardManager import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.common.BuildConfig @@ -63,7 +64,6 @@ import jp.co.soramitsu.common.data.network.connection.NetworkStateListener import jp.co.soramitsu.common.date.DateTimeFormatter import jp.co.soramitsu.common.delegate.WithProgressImpl import jp.co.soramitsu.common.domain.AppStateProvider -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.InvitationHandler import jp.co.soramitsu.common.domain.OptionsProvider import jp.co.soramitsu.common.domain.PushHandler diff --git a/common/src/main/java/jp/co/soramitsu/common/domain/CoroutineManager.kt b/common/src/main/java/jp/co/soramitsu/common/domain/CoroutineManager.kt deleted file mode 100644 index d65c11e72..000000000 --- a/common/src/main/java/jp/co/soramitsu/common/domain/CoroutineManager.kt +++ /dev/null @@ -1,45 +0,0 @@ -/* -This file is part of the SORA network and Polkaswap app. - -Copyright (c) 2020, 2021, Polka Biome Ltd. All rights reserved. -SPDX-License-Identifier: BSD-4-Clause - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list -of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this -list of conditions and the following disclaimer in the documentation and/or other -materials provided with the distribution. - -All advertising materials mentioning features or use of this software must display -the following acknowledgement: This product includes software developed by Polka Biome -Ltd., SORA, and Polkaswap. - -Neither the name of the Polka Biome Ltd. nor the names of its contributors may be used -to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY Polka Biome Ltd. AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Polka Biome Ltd. BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package jp.co.soramitsu.common.domain - -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob - -class CoroutineManager { - val applicationScope = CoroutineScope(SupervisorJob()) - val io = Dispatchers.IO - val main = Dispatchers.Main - - fun createSupervisorScope() = CoroutineScope(Dispatchers.IO + SupervisorJob()) -} diff --git a/common/src/main/java/jp/co/soramitsu/common/domain/DarkThemeManager.kt b/common/src/main/java/jp/co/soramitsu/common/domain/DarkThemeManager.kt index 9cae87af2..cd28bae01 100644 --- a/common/src/main/java/jp/co/soramitsu/common/domain/DarkThemeManager.kt +++ b/common/src/main/java/jp/co/soramitsu/common/domain/DarkThemeManager.kt @@ -38,6 +38,7 @@ import androidx.appcompat.app.AppCompatDelegate import dagger.hilt.android.qualifiers.ApplicationContext import javax.inject.Inject import javax.inject.Singleton +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.data.SoraPreferences import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.channels.BufferOverflow diff --git a/feature_account_impl/src/main/java/jp/co/soramitsu/feature_account_impl/data/repository/UserRepositoryImpl.kt b/feature_account_impl/src/main/java/jp/co/soramitsu/feature_account_impl/data/repository/UserRepositoryImpl.kt index 5d8171a56..d35631cb0 100644 --- a/feature_account_impl/src/main/java/jp/co/soramitsu/feature_account_impl/data/repository/UserRepositoryImpl.kt +++ b/feature_account_impl/src/main/java/jp/co/soramitsu/feature_account_impl/data/repository/UserRepositoryImpl.kt @@ -33,9 +33,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_account_impl.data.repository import androidx.room.withTransaction +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.domain.CardHubType -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.resourses.Language import jp.co.soramitsu.common.resourses.LanguagesHolder import jp.co.soramitsu.core_db.AppDatabase diff --git a/feature_account_impl/src/main/java/jp/co/soramitsu/feature_account_impl/di/AccountFeatureModule.kt b/feature_account_impl/src/main/java/jp/co/soramitsu/feature_account_impl/di/AccountFeatureModule.kt index d34c90516..45e231490 100644 --- a/feature_account_impl/src/main/java/jp/co/soramitsu/feature_account_impl/di/AccountFeatureModule.kt +++ b/feature_account_impl/src/main/java/jp/co/soramitsu/feature_account_impl/di/AccountFeatureModule.kt @@ -37,9 +37,9 @@ import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import javax.inject.Singleton +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.data.EncryptedPreferences import jp.co.soramitsu.common.data.SoraPreferences -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.resourses.LanguagesHolder import jp.co.soramitsu.core_db.AppDatabase import jp.co.soramitsu.feature_account_api.domain.interfaces.CredentialsDatasource diff --git a/feature_account_impl/src/test/java/jp/co/soramitsu/feature_account_impl/data/repository/UserRepositoryTest.kt b/feature_account_impl/src/test/java/jp/co/soramitsu/feature_account_impl/data/repository/UserRepositoryTest.kt index 339752f46..630aad432 100644 --- a/feature_account_impl/src/test/java/jp/co/soramitsu/feature_account_impl/data/repository/UserRepositoryTest.kt +++ b/feature_account_impl/src/test/java/jp/co/soramitsu/feature_account_impl/data/repository/UserRepositoryTest.kt @@ -41,11 +41,11 @@ import io.mockk.impl.annotations.MockK import io.mockk.junit4.MockKRule import io.mockk.mockkStatic import io.mockk.slot +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.common.R import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.domain.CardHubType -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.resourses.Language import jp.co.soramitsu.common.resourses.LanguagesHolder import jp.co.soramitsu.core_db.AppDatabase diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryImpl.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryImpl.kt index 128de4f89..fc6c827d1 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryImpl.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryImpl.kt @@ -36,11 +36,11 @@ import androidx.room.withTransaction import java.math.BigDecimal import java.math.BigInteger import javax.inject.Inject +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.data.network.dto.TokenInfoDto import jp.co.soramitsu.common.domain.Asset import jp.co.soramitsu.common.domain.AssetHolder -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.OptionsProvider import jp.co.soramitsu.common.domain.Token import jp.co.soramitsu.common.domain.WhitelistTokensManager diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/di/AssetsFeatureModule.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/di/AssetsFeatureModule.kt index 6639e36ff..fa9628ae3 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/di/AssetsFeatureModule.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/di/AssetsFeatureModule.kt @@ -37,7 +37,7 @@ import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import javax.inject.Singleton -import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.feature_account_api.domain.interfaces.CredentialsRepository import jp.co.soramitsu.feature_account_api.domain.interfaces.UserRepository import jp.co.soramitsu.feature_assets_api.data.AssetsRepository diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorImpl.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorImpl.kt index 2447227b5..11d79988b 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorImpl.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorImpl.kt @@ -34,12 +34,12 @@ package jp.co.soramitsu.feature_assets_impl.domain import java.math.BigDecimal import java.util.Date +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.format.isZero import jp.co.soramitsu.androidfoundation.format.orZero import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.domain.Asset import jp.co.soramitsu.common.domain.AssetHolder -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.Token import jp.co.soramitsu.common.util.BuildUtils import jp.co.soramitsu.common.util.Flavor diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/assetdetails/AssetDetailsViewModel.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/assetdetails/AssetDetailsViewModel.kt index 97175dbb0..aa82b6a11 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/assetdetails/AssetDetailsViewModel.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/assetdetails/AssetDetailsViewModel.kt @@ -41,6 +41,7 @@ import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import java.math.BigDecimal +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.format.isZero import jp.co.soramitsu.androidfoundation.fragment.SingleLiveEvent import jp.co.soramitsu.androidfoundation.fragment.trigger @@ -48,7 +49,6 @@ import jp.co.soramitsu.androidfoundation.phone.BasicClipboardManager import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.common.R import jp.co.soramitsu.common.domain.AssetHolder -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.formatFiatAmount import jp.co.soramitsu.common.domain.formatFiatChange import jp.co.soramitsu.common.domain.formatFiatOrEmpty diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/receiverequest/QRCodeFlowViewModel.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/receiverequest/QRCodeFlowViewModel.kt index a0cb4e5f3..458ff795a 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/receiverequest/QRCodeFlowViewModel.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/receiverequest/QRCodeFlowViewModel.kt @@ -39,13 +39,13 @@ import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import java.math.BigDecimal import javax.inject.Inject +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.fragment.SingleLiveEvent import jp.co.soramitsu.androidfoundation.phone.BasicClipboardManager import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.common.R import jp.co.soramitsu.common.account.AccountAvatarGenerator import jp.co.soramitsu.common.domain.AssetAmountInputState -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.SoraException import jp.co.soramitsu.common.domain.printFiat import jp.co.soramitsu.common.io.FileManager diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/scan/QrCodeScannerViewModel.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/scan/QrCodeScannerViewModel.kt index 8bb17ad7d..691d932df 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/scan/QrCodeScannerViewModel.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/screens/scan/QrCodeScannerViewModel.kt @@ -39,7 +39,7 @@ import androidx.compose.runtime.setValue import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject -import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.presentation.compose.uikit.tokens.ScreenStatus import jp.co.soramitsu.common.presentation.viewmodel.BaseViewModel import jp.co.soramitsu.common.util.QrCodeDecoder diff --git a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryTest.kt b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryTest.kt index 2fb919e8d..d44f90566 100644 --- a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryTest.kt +++ b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/data/AssetsRepositoryTest.kt @@ -35,10 +35,10 @@ package jp.co.soramitsu.feature_assets_impl.data import androidx.arch.core.executor.testing.InstantTaskExecutorRule import java.math.BigDecimal import java.math.BigInteger +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.domain.Asset -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.common.domain.Token import jp.co.soramitsu.common.domain.WhitelistTokensManager diff --git a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorTest.kt b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorTest.kt index d94605259..6c9b076e6 100644 --- a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorTest.kt +++ b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/domain/AssetsInteractorTest.kt @@ -39,10 +39,10 @@ import io.mockk.junit4.MockKRule import io.mockk.mockkObject import io.mockk.mockkStatic import java.math.BigDecimal +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.domain.Asset -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.OptionsProvider import jp.co.soramitsu.common.domain.Token import jp.co.soramitsu.feature_account_api.domain.interfaces.CredentialsRepository diff --git a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/qr/QrCodeFlowViewModelTest.kt b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/qr/QrCodeFlowViewModelTest.kt index 35e12ccbd..9fc02269b 100644 --- a/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/qr/QrCodeFlowViewModelTest.kt +++ b/feature_assets_impl/src/test/java/jp/co/soramitsu/feature_assets_impl/presentation/qr/QrCodeFlowViewModelTest.kt @@ -44,6 +44,7 @@ import io.mockk.mockk import io.mockk.mockkStatic import io.mockk.verify import java.util.StringJoiner +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.format.Big100 import jp.co.soramitsu.androidfoundation.phone.BasicClipboardManager import jp.co.soramitsu.androidfoundation.resource.ResourceManager @@ -51,7 +52,6 @@ import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.common.account.AccountAvatarGenerator import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.domain.Asset -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.io.FileManager import jp.co.soramitsu.common.util.NumbersFormatter import jp.co.soramitsu.common.util.QrCodeGenerator diff --git a/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerImpl.kt b/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerImpl.kt index f4e4c7957..cf7e3885b 100644 --- a/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerImpl.kt +++ b/feature_blockexplorer_impl/src/main/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerImpl.kt @@ -34,11 +34,11 @@ package jp.co.soramitsu.feature_blockexplorer_impl.domain import java.util.Date import javax.inject.Inject +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.format.safeCast import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.common.R import jp.co.soramitsu.common.date.DateTimeFormatter -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.util.DateTimeUtils import jp.co.soramitsu.feature_account_api.domain.interfaces.UserRepository import jp.co.soramitsu.feature_assets_api.data.AssetsRepository diff --git a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerTest.kt b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerTest.kt index f3bd94b01..7f31c8719 100644 --- a/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerTest.kt +++ b/feature_blockexplorer_impl/src/test/java/jp/co/soramitsu/feature_blockexplorer_impl/domain/TransactionHistoryHandlerTest.kt @@ -32,13 +32,13 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_blockexplorer_impl.domain +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.format.safeCast import jp.co.soramitsu.androidfoundation.format.unsafeCast import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.androidfoundation.testing.test import jp.co.soramitsu.common.date.DateTimeFormatter -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.DEFAULT_ICON_URI import jp.co.soramitsu.common.resourses.LanguagesHolder import jp.co.soramitsu.common.util.NumbersFormatter diff --git a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allcurrencies/AllCurrenciesViewModel.kt b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allcurrencies/AllCurrenciesViewModel.kt index f7354f648..98fe6c331 100644 --- a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allcurrencies/AllCurrenciesViewModel.kt +++ b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allcurrencies/AllCurrenciesViewModel.kt @@ -35,7 +35,7 @@ package jp.co.soramitsu.feature_ecosystem_impl.presentation.allcurrencies import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject -import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.presentation.viewmodel.BaseViewModel import jp.co.soramitsu.feature_ecosystem_impl.domain.EcoSystemMapper import jp.co.soramitsu.feature_ecosystem_impl.domain.EcoSystemTokensInteractor diff --git a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allpools/AllPoolsViewModel.kt b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allpools/AllPoolsViewModel.kt index 3449a8b62..648df0476 100644 --- a/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allpools/AllPoolsViewModel.kt +++ b/feature_ecosystem_impl/src/main/java/jp/co/soramitsu/feature_ecosystem_impl/presentation/allpools/AllPoolsViewModel.kt @@ -35,7 +35,7 @@ package jp.co.soramitsu.feature_ecosystem_impl.presentation.allpools import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject -import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.presentation.viewmodel.BaseViewModel import jp.co.soramitsu.feature_ecosystem_impl.domain.EcoSystemMapper import jp.co.soramitsu.feature_ecosystem_impl.domain.EcoSystemPoolsInteractor diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModel.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModel.kt index 41761e0e7..2a116d042 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModel.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModel.kt @@ -37,8 +37,8 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.fragment.SingleLiveEvent -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.RepeatStrategyBuilder import jp.co.soramitsu.common.presentation.viewmodel.BaseViewModel import jp.co.soramitsu.common.util.ext.setValueIfNew diff --git a/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModelTest.kt b/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModelTest.kt index 6dfd2e966..edfd8bf56 100644 --- a/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModelTest.kt +++ b/feature_main_impl/src/test/java/jp/co/soramitsu/feature_main_impl/presentation/MainViewModelTest.kt @@ -35,9 +35,9 @@ package jp.co.soramitsu.feature_main_impl.presentation import androidx.arch.core.executor.testing.InstantTaskExecutorRule import io.mockk.every import io.mockk.mockkObject +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.androidfoundation.testing.getOrAwaitValue -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.RepeatStrategy import jp.co.soramitsu.common.domain.RepeatStrategyBuilder import jp.co.soramitsu.feature_assets_api.domain.AssetsInteractor diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/OnboardingViewModel.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/OnboardingViewModel.kt index b8e09466a..726dc0a53 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/OnboardingViewModel.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/OnboardingViewModel.kt @@ -47,12 +47,12 @@ import dagger.hilt.android.lifecycle.HiltViewModel import java.net.SocketException import java.net.SocketTimeoutException import javax.inject.Inject +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.fragment.SingleLiveEvent import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.common.R import jp.co.soramitsu.common.account.AccountAvatarGenerator import jp.co.soramitsu.common.account.SoraAccount -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.InvitationHandler import jp.co.soramitsu.common.domain.ResponseCode import jp.co.soramitsu.common.domain.SoraException diff --git a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsViewModel.kt b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsViewModel.kt index 01daf3577..d7464a57f 100644 --- a/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsViewModel.kt +++ b/feature_multiaccount_impl/src/main/java/jp/co/soramitsu/feature_multiaccount_impl/presentation/export_account/account_details/AccountDetailsViewModel.kt @@ -43,13 +43,13 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import java.net.SocketException import java.net.SocketTimeoutException +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.fragment.SingleLiveEvent import jp.co.soramitsu.androidfoundation.fragment.trigger import jp.co.soramitsu.androidfoundation.phone.BasicClipboardManager import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.common.R import jp.co.soramitsu.common.account.SoraAccount -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.OptionsProvider import jp.co.soramitsu.common.domain.SoraException import jp.co.soramitsu.common.presentation.compose.components.initSmallTitle2 diff --git a/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/OnboardingViewModelTest.kt b/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/OnboardingViewModelTest.kt index 3472aedc3..c66cc65b4 100644 --- a/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/OnboardingViewModelTest.kt +++ b/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/OnboardingViewModelTest.kt @@ -34,11 +34,11 @@ package jp.co.soramitsu.feature_multiaccount_impl import androidx.arch.core.executor.testing.InstantTaskExecutorRule import androidx.navigation.NavController +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.common.R import jp.co.soramitsu.common.account.AccountAvatarGenerator -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.InvitationHandler import jp.co.soramitsu.feature_main_api.launcher.MainStarter import jp.co.soramitsu.feature_multiaccount_impl.domain.MultiaccountInteractor diff --git a/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/export/account_details/AccountDetailsViewModelTest.kt b/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/export/account_details/AccountDetailsViewModelTest.kt index 08e06ebdd..c853c4d0a 100644 --- a/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/export/account_details/AccountDetailsViewModelTest.kt +++ b/feature_multiaccount_impl/src/test/java/jp/co/soramitsu/feature_multiaccount_impl/export/account_details/AccountDetailsViewModelTest.kt @@ -37,13 +37,13 @@ import androidx.activity.result.ActivityResultLauncher import androidx.arch.core.executor.testing.InstantTaskExecutorRule import androidx.compose.ui.text.input.TextFieldValue import androidx.navigation.NavController +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.phone.BasicClipboardManager import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.androidfoundation.testing.getOrAwaitValue import jp.co.soramitsu.common.R import jp.co.soramitsu.common.account.SoraAccount -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.feature_main_api.launcher.MainRouter import jp.co.soramitsu.feature_multiaccount_impl.domain.MultiaccountInteractor import jp.co.soramitsu.feature_multiaccount_impl.presentation.export_account.account_details.AccountDetailsViewModel diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/di/PolkaswapFeatureModule.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/di/PolkaswapFeatureModule.kt index 5ee2ddecd..559b0e976 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/di/PolkaswapFeatureModule.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/di/PolkaswapFeatureModule.kt @@ -37,7 +37,7 @@ import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import javax.inject.Singleton -import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.feature_account_api.domain.interfaces.CredentialsRepository import jp.co.soramitsu.feature_account_api.domain.interfaces.UserRepository import jp.co.soramitsu.feature_assets_api.data.AssetsRepository diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/domain/PoolsUpdateSubscriptionImpl.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/domain/PoolsUpdateSubscriptionImpl.kt index 916b62584..8cc6f03a4 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/domain/PoolsUpdateSubscriptionImpl.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/domain/PoolsUpdateSubscriptionImpl.kt @@ -32,7 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_polkaswap_impl.domain -import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.feature_polkaswap_api.domain.interfaces.PolkaswapSubscriptionRepository import jp.co.soramitsu.feature_polkaswap_api.domain.interfaces.PoolsUpdateSubscription import kotlinx.coroutines.flow.Flow diff --git a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddViewModel.kt b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddViewModel.kt index 2666e3fed..909c36dc5 100644 --- a/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddViewModel.kt +++ b/feature_polkaswap_impl/src/main/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/screens/liquidityadd/LiquidityAddViewModel.kt @@ -37,6 +37,7 @@ import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import java.math.BigDecimal +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.coroutine.SuspendableProperty import jp.co.soramitsu.androidfoundation.format.isZero import jp.co.soramitsu.androidfoundation.format.nullZero @@ -45,7 +46,6 @@ import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.common.R import jp.co.soramitsu.common.domain.Asset import jp.co.soramitsu.common.domain.AssetAmountInputState -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.LiquidityDetails import jp.co.soramitsu.common.domain.printFiat import jp.co.soramitsu.common.presentation.compose.states.ButtonState diff --git a/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/liquidity/add/AddLiquidityViewModelTest.kt b/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/liquidity/add/AddLiquidityViewModelTest.kt index ae404bede..f2cbd151d 100644 --- a/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/liquidity/add/AddLiquidityViewModelTest.kt +++ b/feature_polkaswap_impl/src/test/java/jp/co/soramitsu/feature_polkaswap_impl/presentation/polkaswap/liquidity/add/AddLiquidityViewModelTest.kt @@ -35,11 +35,11 @@ package jp.co.soramitsu.feature_polkaswap_impl.presentation.polkaswap.liquidity. import androidx.arch.core.executor.testing.InstantTaskExecutorRule import io.mockk.mockkObject import java.math.BigDecimal +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.format.equalTo import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.common.R -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.logger.FirebaseWrapper import jp.co.soramitsu.common.util.NumbersFormatter import jp.co.soramitsu.common_wallet.domain.model.LiquidityData diff --git a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/NodeManagerImpl.kt b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/NodeManagerImpl.kt index 0d9da50c3..7d08132d3 100644 --- a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/NodeManagerImpl.kt +++ b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/NodeManagerImpl.kt @@ -32,9 +32,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_select_node_impl +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.format.removeHexPrefix import jp.co.soramitsu.common.domain.ChainNode -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.FlavorOptionsProvider import jp.co.soramitsu.common.util.BuildUtils import jp.co.soramitsu.common.util.Flavor diff --git a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/di/SelectNodeFeatureModule.kt b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/di/SelectNodeFeatureModule.kt index 6af0b86e4..e8ce363b4 100644 --- a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/di/SelectNodeFeatureModule.kt +++ b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/di/SelectNodeFeatureModule.kt @@ -37,7 +37,7 @@ import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent import javax.inject.Singleton -import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.core_db.AppDatabase import jp.co.soramitsu.feature_blockexplorer_api.data.SoraConfigManager import jp.co.soramitsu.feature_select_node_api.NodeManager diff --git a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/domain/SelectNodeInteractor.kt b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/domain/SelectNodeInteractor.kt index ddcbd69c9..23f20d5f3 100644 --- a/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/domain/SelectNodeInteractor.kt +++ b/feature_select_node_impl/src/main/java/jp/co/soramitsu/feature_select_node_impl/domain/SelectNodeInteractor.kt @@ -33,8 +33,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package jp.co.soramitsu.feature_select_node_impl.domain import javax.inject.Inject +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.domain.ChainNode -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.feature_select_node_api.data.SelectNodeRepository import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flowOn diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt index 0e98a65f6..c590be16b 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt @@ -34,7 +34,7 @@ package jp.co.soramitsu.feature_sora_card_impl.domain import java.math.BigDecimal import javax.inject.Inject -import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.domain.OptionsProvider import jp.co.soramitsu.common.domain.compareByTotal import jp.co.soramitsu.common.util.ext.splitVersions diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt index 98508fe03..969391ffe 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt @@ -36,6 +36,7 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.format.safeCast import jp.co.soramitsu.androidfoundation.fragment.SingleLiveEvent import jp.co.soramitsu.androidfoundation.resource.ResourceManager @@ -43,7 +44,6 @@ import jp.co.soramitsu.common.R import jp.co.soramitsu.common.domain.Asset import jp.co.soramitsu.common.domain.CardHub import jp.co.soramitsu.common.domain.CardHubType -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.fiatSum import jp.co.soramitsu.common.domain.fiatSymbol import jp.co.soramitsu.common.domain.formatFiatAmount diff --git a/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/presentation/wallet/CardsHubViewModelTest.kt b/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/presentation/wallet/CardsHubViewModelTest.kt index 8a09e4b91..d48d363c8 100644 --- a/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/presentation/wallet/CardsHubViewModelTest.kt +++ b/feature_wallet_impl/src/test/java/jp/co/soramitsu/feature_wallet_impl/presentation/wallet/CardsHubViewModelTest.kt @@ -42,6 +42,7 @@ import io.mockk.junit4.MockKRule import io.mockk.just import io.mockk.mockkObject import io.mockk.verify +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.androidfoundation.resource.ResourceManager import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule import jp.co.soramitsu.androidfoundation.testing.getOrAwaitValue @@ -50,7 +51,6 @@ import jp.co.soramitsu.common.account.SoraAccount import jp.co.soramitsu.common.config.BuildConfigWrapper import jp.co.soramitsu.common.domain.CardHub import jp.co.soramitsu.common.domain.CardHubType -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.domain.OptionsProvider import jp.co.soramitsu.common.interfaces.WithProgress import jp.co.soramitsu.common.util.NumbersFormatter diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/di/SubstrateModule.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/di/SubstrateModule.kt index 5e31c91d0..531332355 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/di/SubstrateModule.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/di/SubstrateModule.kt @@ -41,9 +41,9 @@ import dagger.hilt.InstallIn import dagger.hilt.android.qualifiers.ApplicationContext import dagger.hilt.components.SingletonComponent import javax.inject.Singleton +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.data.network.connection.NetworkStateListener import jp.co.soramitsu.common.domain.AppStateProvider -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.sora.substrate.substrate.ConnectionManager import jp.co.soramitsu.sora.substrate.substrate.SubstrateApi import jp.co.soramitsu.sora.substrate.substrate.SubstrateApiImpl diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/runtime/RuntimeManager.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/runtime/RuntimeManager.kt index e27325d85..9d3983ead 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/runtime/RuntimeManager.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/runtime/RuntimeManager.kt @@ -36,8 +36,8 @@ import com.google.gson.Gson import java.math.BigInteger import javax.inject.Inject import javax.inject.Singleton +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.data.SoraPreferences -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.common.io.FileManager import jp.co.soramitsu.common.logger.FirebaseWrapper import jp.co.soramitsu.feature_blockexplorer_api.data.SoraConfigManager diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/substrate/ExtrinsicManager.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/substrate/ExtrinsicManager.kt index beb8c4a9e..6199edb91 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/substrate/ExtrinsicManager.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/substrate/ExtrinsicManager.kt @@ -35,7 +35,7 @@ package jp.co.soramitsu.sora.substrate.substrate import java.math.BigInteger import javax.inject.Inject import javax.inject.Singleton -import jp.co.soramitsu.common.domain.CoroutineManager +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.logger.FirebaseWrapper import jp.co.soramitsu.sora.substrate.models.ExtrinsicStatusResponse import jp.co.soramitsu.sora.substrate.models.ExtrinsicSubmitStatus diff --git a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/substrate/WsConnectionManager.kt b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/substrate/WsConnectionManager.kt index 232b2e8ab..a78382f64 100644 --- a/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/substrate/WsConnectionManager.kt +++ b/sorasubstrate/src/main/java/jp/co/soramitsu/sora/substrate/substrate/WsConnectionManager.kt @@ -34,9 +34,9 @@ package jp.co.soramitsu.sora.substrate.substrate import android.content.Context import dagger.hilt.android.qualifiers.ApplicationContext +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager import jp.co.soramitsu.common.data.network.connection.NetworkStateListener import jp.co.soramitsu.common.domain.AppStateProvider -import jp.co.soramitsu.common.domain.CoroutineManager import jp.co.soramitsu.xsubstrate.wsrpc.SocketService import jp.co.soramitsu.xsubstrate.wsrpc.networkStateFlow import jp.co.soramitsu.xsubstrate.wsrpc.state.SocketStateMachine From 4088d33056bedb8128462987c1cf6f17752f6c12 Mon Sep 17 00:00:00 2001 From: arvifox Date: Tue, 30 Jul 2024 16:33:51 +0300 Subject: [PATCH 2/2] sc-42 --- .../assetdetails/AssetDetailsBalanceCard.kt | 9 +- .../presentation/profile/ProfileScreen.kt | 18 +-- .../domain/SoraCardInteractorImpl.kt | 91 +++++++------ .../details/SoraCardDetailsViewModel.kt | 10 +- .../details/SoraCardMainSoraContentCard.kt | 2 +- .../get/card/SoraCardInteractorTest.kt | 120 ++++++++++++++++++ .../data/repository/WalletRepositoryImpl.kt | 3 +- .../cardshub/CardsHubViewModel.kt | 1 - gradle/libs.versions.toml | 4 +- 9 files changed, 196 insertions(+), 62 deletions(-) create mode 100644 feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/SoraCardInteractorTest.kt diff --git a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/assetdetails/AssetDetailsBalanceCard.kt b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/assetdetails/AssetDetailsBalanceCard.kt index db0ce31e7..44cdcf20f 100644 --- a/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/assetdetails/AssetDetailsBalanceCard.kt +++ b/feature_assets_impl/src/main/java/jp/co/soramitsu/feature_assets_impl/presentation/components/compose/assetdetails/AssetDetailsBalanceCard.kt @@ -63,6 +63,7 @@ import jp.co.soramitsu.ui_core.component.button.BleachedButton import jp.co.soramitsu.ui_core.component.button.properties.Order import jp.co.soramitsu.ui_core.component.button.properties.Size import jp.co.soramitsu.ui_core.component.card.ContentCard +import jp.co.soramitsu.ui_core.extensions.withOpacity import jp.co.soramitsu.ui_core.resources.Dimens import jp.co.soramitsu.ui_core.theme.customColors import jp.co.soramitsu.ui_core.theme.customTypography @@ -186,17 +187,20 @@ internal fun AssetDetailsBalanceCard( AmountCardIcon( res = R.drawable.ic_new_arrow_up_24, text = stringResource(id = R.string.common_send), + enabled = true, onClick = onSendClick, ) } AmountCardIcon( res = R.drawable.ic_new_arrow_down_24, text = stringResource(id = R.string.common_receive), + enabled = true, onClick = onReceiveClick, ) AmountCardIcon( res = R.drawable.ic_refresh_24, text = stringResource(id = R.string.polkaswap_swap_title), + enabled = true, onClick = onSwapClick, ) @@ -204,6 +208,7 @@ internal fun AssetDetailsBalanceCard( AmountCardIcon( res = R.drawable.ic_buy_crypto, text = stringResource(id = R.string.common_buy), + enabled = false, onClick = onBuyCryptoClick ) } @@ -216,6 +221,7 @@ internal fun AssetDetailsBalanceCard( private fun AmountCardIcon( @DrawableRes res: Int, text: String, + enabled: Boolean, onClick: () -> Unit, ) { Column( @@ -228,6 +234,7 @@ private fun AmountCardIcon( shape = CircleShape, size = Size.Large, order = Order.TERTIARY, + enabled = enabled, leftIcon = painterResource(res), onClick = onClick, ) @@ -238,7 +245,7 @@ private fun AmountCardIcon( .padding(top = Dimens.x1), text = text, style = MaterialTheme.customTypography.textXSBold, - color = MaterialTheme.customColors.fgSecondary, + color = MaterialTheme.customColors.fgSecondary.withOpacity(opacity = if (enabled) 1.0f else 0.3f), ) } } diff --git a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/ProfileScreen.kt b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/ProfileScreen.kt index 439e20f53..dd939ca94 100644 --- a/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/ProfileScreen.kt +++ b/feature_main_impl/src/main/java/jp/co/soramitsu/feature_main_impl/presentation/profile/ProfileScreen.kt @@ -85,15 +85,15 @@ internal fun ProfileItems( icon = R.drawable.ic_buy_crypto, onClick = onSoraCardClick, ) - CategoryItem( - modifier = Modifier - .testTagAsId("BuyXor") - .padding(top = Dimens.x2), - title = stringResource(id = R.string.buy_crypto_buy_xor_with_fiat_title), - subtitle = stringResource(id = R.string.buy_crypto_buy_xor_with_fiat_subtitle), - icon = R.drawable.ic_settings_buy_crypto, - onClick = onBuyCrypto, - ) +// CategoryItem( +// modifier = Modifier +// .testTagAsId("BuyXor") +// .padding(top = Dimens.x2), +// title = stringResource(id = R.string.buy_crypto_buy_xor_with_fiat_title), +// subtitle = stringResource(id = R.string.buy_crypto_buy_xor_with_fiat_subtitle), +// icon = R.drawable.ic_settings_buy_crypto, +// onClick = onBuyCrypto, +// ) } CategoryItem( modifier = Modifier diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt index c590be16b..c49de8505 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/domain/SoraCardInteractorImpl.kt @@ -48,16 +48,20 @@ import jp.co.soramitsu.oauth.base.sdk.contract.IbanInfo import jp.co.soramitsu.oauth.base.sdk.contract.SoraCardCommonVerification import jp.co.soramitsu.sora.substrate.runtime.SubstrateOptionsProvider import kotlin.math.min +import kotlinx.coroutines.FlowPreview +import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map +import kotlinx.coroutines.launch internal class SoraCardInteractorImpl @Inject constructor( private val assetsInteractor: AssetsInteractor, @@ -82,51 +86,60 @@ internal class SoraCardInteractorImpl @Inject constructor( private val _ibanFlow = MutableStateFlow(null) private val _phoneFlow = MutableStateFlow("") + private val _verStatus = MutableStateFlow(SoraCardCommonVerification.NotFound) + @OptIn(FlowPreview::class) @Suppress("UNCHECKED_CAST") override suspend fun initialize() { - combine( - flow { emit(soraCardClientProxy.init()) }, - needInstallUpdate(), - fetchApplicationFee(), - _ibanFlow.asStateFlow(), - subscribeToSoraCardAvailabilityFlow(), - checkSoraCardPending(), - _phoneFlow.asStateFlow(), - ) { flows -> - val init = flows[0] as Pair - val needUpdate = flows[1] as Boolean - val fee = flows[2] as String - val ibanInfo = flows[3] as IbanInfo? - val availability = flows[4] as SoraCardAvailabilityInfo - val verification = flows[5] as SoraCardCommonVerification - val phone = flows[6] as String - SoraCardBasicStatus( - initialized = init.first, - initError = init.second, - availabilityInfo = availability, - verification = verification, - needInstallUpdate = needUpdate, - applicationFee = fee, - ibanInfo = ibanInfo, - phone = phone, - ) - } - .debounce(1000) - .collect { - _soraCardBasicStatus.value = it + coroutineScope { + launch { + resetInfo() } - resetInfo() + launch { + checkSoraCardPending() + } + combine( + flow { emit(soraCardClientProxy.init()) }, + needInstallUpdate(), + fetchApplicationFee(), + _ibanFlow.asStateFlow(), + subscribeToSoraCardAvailabilityFlow(), + _verStatus.asStateFlow(), + _phoneFlow.asStateFlow(), + ) { flows -> + val init = flows[0] as Pair + val needUpdate = flows[1] as Boolean + val fee = flows[2] as String + val ibanInfo = flows[3] as IbanInfo? + val availability = flows[4] as SoraCardAvailabilityInfo + val verification = flows[5] as SoraCardCommonVerification + val phone = flows[6] as String + SoraCardBasicStatus( + initialized = init.first, + initError = init.second, + availabilityInfo = availability, + verification = verification, + needInstallUpdate = needUpdate, + applicationFee = fee, + ibanInfo = ibanInfo, + phone = phone, + ) + } + .debounce(1000) + .collectLatest { + _soraCardBasicStatus.value = it + } + } } override val basicStatus: StateFlow = _soraCardBasicStatus.asStateFlow() - private suspend fun checkSoraCardPending() = flow { + private suspend fun checkSoraCardPending() { var isLoopInProgress = true while (isLoopInProgress) { val status = soraCardClientProxy.getKycStatus().getOrDefault(SoraCardCommonVerification.NotFound) - emit(status) + _verStatus.value = status if (status != SoraCardCommonVerification.Pending) { isLoopInProgress = false } else { @@ -156,19 +169,15 @@ internal class SoraCardInteractorImpl @Inject constructor( } override suspend fun setStatus(status: SoraCardCommonVerification) { - _soraCardBasicStatus.value = _soraCardBasicStatus.value.copy( - verification = status, - ) + _verStatus.value = status resetInfo() } override suspend fun setLogout() { soraCardClientProxy.logout() - _soraCardBasicStatus.value = _soraCardBasicStatus.value.copy( - verification = SoraCardCommonVerification.NotFound, - ibanInfo = null, - phone = null, - ) + _verStatus.value = SoraCardCommonVerification.NotFound + _ibanFlow.value = null + _phoneFlow.value = "" } private fun subscribeToSoraCardAvailabilityFlow() = diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt index e05e879c9..804e1365a 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardDetailsViewModel.kt @@ -108,12 +108,10 @@ class SoraCardDetailsViewModel @Inject constructor( ibanCache = basicStatus.ibanInfo val phoneFormatted = basicStatus.phone?.let { "+$it" } _soraCardDetailsScreenState.value = local.copy( - soraCardIBANCardState = basicStatus.ibanInfo?.let { iban -> - SoraCardIBANCardState( - iban.iban, - iban.ibanStatus == IbanStatus.CLOSED, - ) - }, + soraCardIBANCardState = SoraCardIBANCardState( + iban = basicStatus.ibanInfo?.iban.orEmpty(), + closed = basicStatus.ibanInfo?.ibanStatus == IbanStatus.CLOSED, + ), soraCardMainSoraContentCardState = local.soraCardMainSoraContentCardState.copy( balance = basicStatus.ibanInfo?.balance, phone = phoneFormatted, diff --git a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt index 852c70fcd..579d9ced8 100644 --- a/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt +++ b/feature_sora_card_impl/src/main/java/jp/co/soramitsu/feature_sora_card_impl/presentation/details/SoraCardMainSoraContentCard.kt @@ -180,7 +180,7 @@ fun SoraCardMainSoraContentCard( .padding(horizontal = Dimens.x1) .weight(1f), size = Size.Large, - enabled = true, + enabled = false, order = Order.PRIMARY, onClick = onExchangeXor, text = stringResource(id = jp.co.soramitsu.oauth.R.string.exchange_xor), diff --git a/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/SoraCardInteractorTest.kt b/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/SoraCardInteractorTest.kt new file mode 100644 index 000000000..dcaaa75af --- /dev/null +++ b/feature_sora_card_impl/src/test/java/jp/co/soramitsu/feature_sora_card_impl/presentation/get/card/SoraCardInteractorTest.kt @@ -0,0 +1,120 @@ +package jp.co.soramitsu.feature_sora_card_impl.presentation.get.card + +import java.math.BigDecimal +import jp.co.soramitsu.androidfoundation.coroutine.CoroutineManager +import jp.co.soramitsu.androidfoundation.testing.MainCoroutineRule +import jp.co.soramitsu.demeter.domain.DemeterFarmingInteractor +import jp.co.soramitsu.feature_assets_api.domain.AssetsInteractor +import jp.co.soramitsu.feature_polkaswap_api.domain.interfaces.PoolsInteractor +import jp.co.soramitsu.feature_sora_card_api.domain.SoraCardInteractor +import jp.co.soramitsu.feature_sora_card_impl.domain.SoraCardClientProxy +import jp.co.soramitsu.feature_sora_card_impl.domain.SoraCardInteractorImpl +import jp.co.soramitsu.oauth.base.sdk.contract.IbanInfo +import jp.co.soramitsu.oauth.base.sdk.contract.IbanStatus +import jp.co.soramitsu.oauth.base.sdk.contract.SoraCardCommonVerification +import jp.co.soramitsu.test_data.PolkaswapTestData.POOL_DATA +import jp.co.soramitsu.test_data.TestAssets +import kotlin.time.Duration.Companion.milliseconds +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.flow.flowOf +import kotlinx.coroutines.launch +import kotlinx.coroutines.test.UnconfinedTestDispatcher +import kotlinx.coroutines.test.advanceTimeBy +import kotlinx.coroutines.test.advanceUntilIdle +import kotlinx.coroutines.test.runTest +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.Mock +import org.mockito.Mockito.`when` +import org.mockito.junit.MockitoJUnitRunner +import org.mockito.kotlin.any +import org.mockito.kotlin.doReturn +import org.mockito.kotlin.wheneverBlocking + +@RunWith(MockitoJUnitRunner::class) +@OptIn(ExperimentalCoroutinesApi::class) +class SoraCardInteractorTest { + + @get:Rule + var mainCoroutineRule = MainCoroutineRule() + + @Mock + private lateinit var ai: AssetsInteractor + + @Mock + private lateinit var pi: PoolsInteractor + + @Mock + private lateinit var sccp: SoraCardClientProxy + + @Mock + private lateinit var dfi: DemeterFarmingInteractor + + @Mock + private lateinit var cm: CoroutineManager + + private lateinit var soraCardInteractor: SoraCardInteractor + + @OptIn(ExperimentalStdlibApi::class) + @Before + fun setUp() = runTest { + `when`(cm.io).thenReturn(this.coroutineContext[CoroutineDispatcher]!!) + wheneverBlocking { sccp.init() } doReturn (true to "") + wheneverBlocking { sccp.getVersion() } doReturn Result.success("2.3.4") + wheneverBlocking { sccp.getApplicationFee() } doReturn "$8.98" + wheneverBlocking { + sccp.getKycStatus() + } doReturn Result.success(SoraCardCommonVerification.Successful) + wheneverBlocking { ai.subscribeAssetOfCurAccount(any()) } doReturn flowOf(TestAssets.xorAsset()) + wheneverBlocking { pi.getPoolsCacheOfCurAccount() } doReturn listOf(POOL_DATA) + wheneverBlocking { dfi.getStakedFarmedBalanceOfAsset(any()) } doReturn BigDecimal.ONE + soraCardInteractor = SoraCardInteractorImpl( + assetsInteractor = ai, + poolsInteractor = pi, + soraCardClientProxy = sccp, + demeterFarmingInteractor = dfi, + coroutineManager = cm, + ) + } + + @Test + fun `test init with full data`() = runTest { + wheneverBlocking { sccp.getIBAN() } doReturn Result.success( + IbanInfo( + "iban", + IbanStatus.ACTIVE, + "$12.34", + "ok", + ) + ) + wheneverBlocking { sccp.getPhone() } doReturn "+123" + advanceUntilIdle() + backgroundScope.launch(UnconfinedTestDispatcher(testScheduler)) { + soraCardInteractor.initialize() + } + advanceTimeBy(1100.milliseconds) + val bs = soraCardInteractor.basicStatus.value + assertTrue(bs.initialized) + } + + @Test + fun `test call status set`() = runTest { + wheneverBlocking { sccp.getIBAN() } doReturn Result.success(null) + wheneverBlocking { sccp.getPhone() } doReturn "+123" + advanceUntilIdle() + backgroundScope.launch(UnconfinedTestDispatcher(testScheduler)) { + soraCardInteractor.initialize() + } + advanceTimeBy(1100.milliseconds) + var bs = soraCardInteractor.basicStatus.value + assertTrue(bs.initialized) + soraCardInteractor.setStatus(SoraCardCommonVerification.Pending) + advanceUntilIdle() + bs = soraCardInteractor.basicStatus.value + assertTrue(bs.initialized) + } +} diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/data/repository/WalletRepositoryImpl.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/data/repository/WalletRepositoryImpl.kt index 60966ff07..39a1e9f57 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/data/repository/WalletRepositoryImpl.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/data/repository/WalletRepositoryImpl.kt @@ -129,7 +129,8 @@ class WalletRepositoryImpl @Inject constructor( val card = CardsHubMapper.map(cardLocal) when (card?.cardType) { CardHubType.GET_SORA_CARD -> if (soraCard) card else null - CardHubType.BUY_XOR_TOKEN -> if (soraCard) card else null +// CardHubType.BUY_XOR_TOKEN -> if (soraCard) card else null + CardHubType.BUY_XOR_TOKEN -> null else -> card } } diff --git a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt index 969391ffe..ef9221a2a 100644 --- a/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt +++ b/feature_wallet_impl/src/main/java/jp/co/soramitsu/feature_wallet_impl/presentation/cardshub/CardsHubViewModel.kt @@ -144,7 +144,6 @@ class CardsHubViewModel @Inject constructor( _state.value = _state.value.copy( accountAddress = data.first.substrateAddress, curAccount = data.first.accountTitle(), - loading = false, ) val flows = data.second.filter { it.visibility }.map { cardHub -> when (cardHub.cardType) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 52660d701..fc48ed339 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,7 +16,7 @@ svg = "1.4" jdenticon = "1.1" archFragmentTest = "1.7.1" mockk = "1.13.8" -truth = "1.1.5" +truth = "1.4.2" mockitoKotlin = "5.2.1" mockito = "5.2.0" junit = "4.13.2" @@ -39,7 +39,7 @@ firebaseAppDistribution = "3.2.0" tripletVersion = "3.8.4" timber = "5.0.1" ktor = "2.3.1" -soracard = "1.1.15" +soracard = "1.1.16" xnetworkingLib = "1.0.7" xsubstrate = "1.2.7" uicore = "0.2.32"