From 81d82cfbf8afd38173ada99c130d319ea38060a9 Mon Sep 17 00:00:00 2001 From: antonijzelinskij Date: Thu, 10 Oct 2024 13:37:22 +0200 Subject: [PATCH 1/3] Block swipe gov for unsupported chains when proxied is using --- .../tindergov/TinderGovInteractor.kt | 11 ++++++ .../StartStakingLandingValidationSystem.kt | 14 ++++++++ .../StartSwipeGovValidationFailure.kt | 14 ++++++++ .../StartSwipeGovValidationPayload.kt | 9 +++++ .../referenda/list/ReferendaListFragment.kt | 3 ++ .../referenda/list/ReferendaListViewModel.kt | 34 ++++++++++++++++--- .../referenda/list/di/ReferendaListModule.kt | 12 +++++-- .../validation/StartSwipeGovValidationUi.kt | 22 ++++++++++++ 8 files changed, 113 insertions(+), 6 deletions(-) create mode 100644 feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartStakingLandingValidationSystem.kt create mode 100644 feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartSwipeGovValidationFailure.kt create mode 100644 feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartSwipeGovValidationPayload.kt create mode 100644 feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/validation/StartSwipeGovValidationUi.kt diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/TinderGovInteractor.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/TinderGovInteractor.kt index 76beae00a3..ca594501f8 100644 --- a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/TinderGovInteractor.kt +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/TinderGovInteractor.kt @@ -2,6 +2,7 @@ package io.novafoundation.nova.feature_governance_impl.domain.referendum.tinderg import io.novafoundation.nova.common.domain.filterLoaded import io.novafoundation.nova.common.utils.flowOfAll +import io.novafoundation.nova.common.validation.ValidationSystem import io.novafoundation.nova.feature_account_api.domain.interfaces.AccountRepository import io.novafoundation.nova.feature_governance_api.data.model.TinderGovBasketItem import io.novafoundation.nova.feature_governance_api.data.model.VotingPower @@ -17,6 +18,10 @@ import io.novafoundation.nova.feature_governance_impl.data.repository.tindergov. import io.novafoundation.nova.feature_governance_impl.domain.referendum.details.call.ReferendumPreImageParser import io.novafoundation.nova.feature_governance_impl.domain.referendum.list.ReferendaSharedComputation import io.novafoundation.nova.feature_governance_impl.domain.referendum.list.filtering.ReferendaFilteringProvider +import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.StartStakingLandingValidationSystem +import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.StartSwipeGovValidationFailure +import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.StartSwipeGovValidationPayload +import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.startSwipeGovValidation import io.novafoundation.nova.feature_wallet_api.domain.AssetUseCase import io.novafoundation.nova.feature_wallet_api.domain.getCurrentAsset import io.novafoundation.nova.feature_wallet_api.domain.model.Asset @@ -54,6 +59,8 @@ interface TinderGovInteractor { suspend fun getVotingPowerState(): VotingPowerState suspend fun awaitAllItemsVoted(coroutineScope: CoroutineScope, basket: List) + + fun startSwipeGovValidationSystem(): StartStakingLandingValidationSystem } class RealTinderGovInteractor( @@ -130,6 +137,10 @@ class RealTinderGovInteractor( }.first() } + override fun startSwipeGovValidationSystem(): StartStakingLandingValidationSystem { + return ValidationSystem.startSwipeGovValidation() + } + private fun TinderGovBasketItem.isItemNotAvailableToVote( availableToVoteReferenda: Set, asset: Asset diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartStakingLandingValidationSystem.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartStakingLandingValidationSystem.kt new file mode 100644 index 0000000000..abb109bf3a --- /dev/null +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartStakingLandingValidationSystem.kt @@ -0,0 +1,14 @@ +package io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation + +import io.novafoundation.nova.common.validation.ValidationSystem +import io.novafoundation.nova.feature_account_api.domain.validation.hasChainAccount + +typealias StartStakingLandingValidationSystem = ValidationSystem + +fun ValidationSystem.Companion.startSwipeGovValidation(): StartStakingLandingValidationSystem = ValidationSystem { + hasChainAccount( + chain = { it.chain }, + metaAccount = { it.metaAccount }, + error = StartSwipeGovValidationFailure::NoChainAccountFound + ) +} diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartSwipeGovValidationFailure.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartSwipeGovValidationFailure.kt new file mode 100644 index 0000000000..dc782e4bd1 --- /dev/null +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartSwipeGovValidationFailure.kt @@ -0,0 +1,14 @@ +package io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation + +import io.novafoundation.nova.feature_account_api.domain.model.MetaAccount +import io.novafoundation.nova.feature_account_api.domain.validation.NoChainAccountFoundError +import io.novafoundation.nova.runtime.multiNetwork.chain.model.Chain + +sealed class StartSwipeGovValidationFailure { + + class NoChainAccountFound( + override val chain: Chain, + override val account: MetaAccount, + override val addAccountState: NoChainAccountFoundError.AddAccountState + ) : StartSwipeGovValidationFailure(), NoChainAccountFoundError +} diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartSwipeGovValidationPayload.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartSwipeGovValidationPayload.kt new file mode 100644 index 0000000000..d27cff5cb7 --- /dev/null +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/validation/StartSwipeGovValidationPayload.kt @@ -0,0 +1,9 @@ +package io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation + +import io.novafoundation.nova.feature_account_api.domain.model.MetaAccount +import io.novafoundation.nova.runtime.multiNetwork.chain.model.Chain + +class StartSwipeGovValidationPayload( + val chain: Chain, + val metaAccount: MetaAccount +) diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListFragment.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListFragment.kt index e284d5e9b4..5ccafa4fc6 100644 --- a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListFragment.kt +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListFragment.kt @@ -8,6 +8,7 @@ import androidx.recyclerview.widget.ConcatAdapter import coil.ImageLoader import io.novafoundation.nova.common.di.FeatureUtils import io.novafoundation.nova.common.domain.dataOrNull +import io.novafoundation.nova.common.mixin.impl.observeValidations import io.novafoundation.nova.feature_governance_api.di.GovernanceFeatureApi import io.novafoundation.nova.feature_governance_impl.R import io.novafoundation.nova.feature_governance_impl.di.GovernanceFeatureComponent @@ -50,6 +51,8 @@ class ReferendaListFragment : BaseReferendaListFragment( override fun subscribe(viewModel: ReferendaListViewModel) { subscribeOnAssetClick(viewModel.assetSelectorMixin, imageLoader) + observeValidations(viewModel) + subscribeOnAssetChange(viewModel.assetSelectorMixin) { referendaHeaderAdapter.setAsset(it) } diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt index 176e60a989..3f7f0ece25 100644 --- a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt @@ -7,6 +7,7 @@ import io.novafoundation.nova.common.domain.ExtendedLoadingState import io.novafoundation.nova.common.domain.dataOrNull import io.novafoundation.nova.common.list.toListWithHeaders import io.novafoundation.nova.common.domain.mapLoading +import io.novafoundation.nova.common.mixin.api.Validatable import io.novafoundation.nova.common.resources.ResourceManager import io.novafoundation.nova.common.utils.LOG_TAG import io.novafoundation.nova.common.utils.combineToPair @@ -14,6 +15,8 @@ import io.novafoundation.nova.common.utils.firstLoaded import io.novafoundation.nova.common.utils.formatting.format import io.novafoundation.nova.common.utils.inBackground import io.novafoundation.nova.common.utils.withItemScope +import io.novafoundation.nova.common.validation.ValidationExecutor +import io.novafoundation.nova.common.validation.progressConsumer import io.novafoundation.nova.common.view.PlaceholderModel import io.novafoundation.nova.core.updater.UpdateSystem import io.novafoundation.nova.feature_account_api.domain.interfaces.SelectedAccountUseCase @@ -34,10 +37,13 @@ import io.novafoundation.nova.feature_governance_impl.presentation.GovernanceRou import io.novafoundation.nova.feature_governance_impl.presentation.referenda.common.ReferendumFormatter import io.novafoundation.nova.feature_governance_impl.presentation.referenda.common.list.ReferendaListStateModel import io.novafoundation.nova.feature_governance_api.presentation.referenda.details.ReferendumDetailsPayload +import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.TinderGovInteractor +import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.StartSwipeGovValidationPayload import io.novafoundation.nova.feature_governance_impl.presentation.referenda.list.model.ReferendaGroupModel import io.novafoundation.nova.feature_governance_impl.presentation.referenda.list.model.ReferendumModel import io.novafoundation.nova.feature_governance_impl.presentation.referenda.list.model.TinderGovBannerModel import io.novafoundation.nova.feature_governance_impl.presentation.referenda.list.model.toReferendumDetailsPrefilledData +import io.novafoundation.nova.feature_governance_impl.presentation.referenda.list.validation.handleStartSwipeGovValidationFailure import io.novafoundation.nova.feature_governance_impl.presentation.view.GovernanceLocksModel import io.novafoundation.nova.feature_wallet_api.domain.model.Asset import io.novafoundation.nova.feature_wallet_api.presentation.mixin.assetSelector.AssetSelectorFactory @@ -64,8 +70,12 @@ class ReferendaListViewModel( private val governanceRouter: GovernanceRouter, private val referendumFormatter: ReferendumFormatter, private val governanceDAppsInteractor: GovernanceDAppsInteractor, - private val referendaSummaryInteractor: ReferendaSummaryInteractor -) : BaseViewModel(), WithAssetSelector { + private val referendaSummaryInteractor: ReferendaSummaryInteractor, + private val tinderGovInteractor: TinderGovInteractor, + private val selectedMetaAccountUseCase: SelectedAccountUseCase, + private val validationExecutor: ValidationExecutor, +) : BaseViewModel(), WithAssetSelector, + Validatable by validationExecutor { override val assetSelectorMixin = assetSelectorFactory.create( scope = this, @@ -148,8 +158,24 @@ class ReferendaListViewModel( governanceRouter.openReferendum(payload) } - fun openTinderGovCards() { - governanceRouter.openTinderGovCards() + fun openTinderGovCards() = launch { + val payload = StartSwipeGovValidationPayload( + chain = selectedAssetSharedState.chain(), + metaAccount = selectedMetaAccountUseCase.getSelectedMetaAccount() + ) + + validationExecutor.requireValid( + validationSystem = tinderGovInteractor.startSwipeGovValidationSystem(), + payload = payload, + validationFailureTransformerCustom = { validationFailure, _ -> + handleStartSwipeGovValidationFailure( + resourceManager, + validationFailure + ) + } + ) { + governanceRouter.openTinderGovCards() + } } private fun mapLocksOverviewToUi(locksOverview: GovernanceLocksOverview?, asset: Asset): GovernanceLocksModel? { diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/di/ReferendaListModule.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/di/ReferendaListModule.kt index 38f39b5a48..4dcb779f0e 100644 --- a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/di/ReferendaListModule.kt +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/di/ReferendaListModule.kt @@ -9,6 +9,7 @@ import dagger.multibindings.IntoMap import io.novafoundation.nova.common.di.viewmodel.ViewModelKey import io.novafoundation.nova.common.di.viewmodel.ViewModelModule import io.novafoundation.nova.common.resources.ResourceManager +import io.novafoundation.nova.common.validation.ValidationExecutor import io.novafoundation.nova.core.updater.UpdateSystem import io.novafoundation.nova.feature_account_api.domain.interfaces.SelectedAccountUseCase import io.novafoundation.nova.feature_governance_api.domain.referendum.list.ReferendaListInteractor @@ -16,6 +17,7 @@ import io.novafoundation.nova.feature_governance_impl.domain.summary.ReferendaSu import io.novafoundation.nova.feature_governance_impl.data.GovernanceSharedState import io.novafoundation.nova.feature_governance_impl.domain.dapp.GovernanceDAppsInteractor import io.novafoundation.nova.feature_governance_impl.domain.filters.ReferendaFiltersInteractor +import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.TinderGovInteractor import io.novafoundation.nova.feature_governance_impl.presentation.GovernanceRouter import io.novafoundation.nova.feature_governance_impl.presentation.referenda.common.ReferendumFormatter import io.novafoundation.nova.feature_governance_impl.presentation.referenda.list.ReferendaListViewModel @@ -38,7 +40,10 @@ class ReferendaListModule { governanceRouter: GovernanceRouter, referendumFormatter: ReferendumFormatter, governanceDAppsInteractor: GovernanceDAppsInteractor, - summaryInteractor: ReferendaSummaryInteractor + summaryInteractor: ReferendaSummaryInteractor, + tinderGovInteractor: TinderGovInteractor, + selectedMetaAccountUseCase: SelectedAccountUseCase, + validationExecutor: ValidationExecutor, ): ViewModel { return ReferendaListViewModel( assetSelectorFactory = assetSelectorFactory, @@ -51,7 +56,10 @@ class ReferendaListModule { governanceRouter = governanceRouter, referendumFormatter = referendumFormatter, governanceDAppsInteractor = governanceDAppsInteractor, - referendaSummaryInteractor = summaryInteractor + referendaSummaryInteractor = summaryInteractor, + tinderGovInteractor = tinderGovInteractor, + selectedMetaAccountUseCase = selectedMetaAccountUseCase, + validationExecutor = validationExecutor ) } diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/validation/StartSwipeGovValidationUi.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/validation/StartSwipeGovValidationUi.kt new file mode 100644 index 0000000000..c3380e931b --- /dev/null +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/validation/StartSwipeGovValidationUi.kt @@ -0,0 +1,22 @@ +package io.novafoundation.nova.feature_governance_impl.presentation.referenda.list.validation + +import io.novafoundation.nova.common.resources.ResourceManager +import io.novafoundation.nova.common.validation.TransformedFailure +import io.novafoundation.nova.common.validation.ValidationStatus +import io.novafoundation.nova.feature_account_api.domain.validation.handleChainAccountNotFound +import io.novafoundation.nova.feature_governance_impl.R +import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.StartSwipeGovValidationFailure + +fun handleStartSwipeGovValidationFailure( + resourceManager: ResourceManager, + validationStatus: ValidationStatus.NotValid +): TransformedFailure { + return when (val reason = validationStatus.reason) { + is StartSwipeGovValidationFailure.NoChainAccountFound -> handleChainAccountNotFound( + failure = reason, + addAccountDescriptionRes = R.string.common_network_not_supported, + resourceManager = resourceManager, + goToWalletDetails = { } + ) + } +} From ebe260a7c420430064f5507678f26ff726aac102 Mon Sep 17 00:00:00 2001 From: antonijzelinskij Date: Tue, 15 Oct 2024 09:14:08 +0200 Subject: [PATCH 2/3] Redirect to wallet details --- .../presentation/referenda/list/ReferendaListViewModel.kt | 3 ++- .../referenda/list/validation/StartSwipeGovValidationUi.kt | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt index 3f7f0ece25..2ae22f6eb8 100644 --- a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt @@ -170,7 +170,8 @@ class ReferendaListViewModel( validationFailureTransformerCustom = { validationFailure, _ -> handleStartSwipeGovValidationFailure( resourceManager, - validationFailure + validationFailure, + governanceRouter ) } ) { diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/validation/StartSwipeGovValidationUi.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/validation/StartSwipeGovValidationUi.kt index c3380e931b..71309d053d 100644 --- a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/validation/StartSwipeGovValidationUi.kt +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/validation/StartSwipeGovValidationUi.kt @@ -6,17 +6,19 @@ import io.novafoundation.nova.common.validation.ValidationStatus import io.novafoundation.nova.feature_account_api.domain.validation.handleChainAccountNotFound import io.novafoundation.nova.feature_governance_impl.R import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.StartSwipeGovValidationFailure +import io.novafoundation.nova.feature_governance_impl.presentation.GovernanceRouter fun handleStartSwipeGovValidationFailure( resourceManager: ResourceManager, - validationStatus: ValidationStatus.NotValid + validationStatus: ValidationStatus.NotValid, + router: GovernanceRouter ): TransformedFailure { return when (val reason = validationStatus.reason) { is StartSwipeGovValidationFailure.NoChainAccountFound -> handleChainAccountNotFound( failure = reason, addAccountDescriptionRes = R.string.common_network_not_supported, resourceManager = resourceManager, - goToWalletDetails = { } + goToWalletDetails = { router.openWalletDetails(reason.account.id) } ) } } From 9af72eeecc0f1234a5f9bf4d1dfe77f07ea77df9 Mon Sep 17 00:00:00 2001 From: antonijzelinskij Date: Tue, 15 Oct 2024 09:29:49 +0200 Subject: [PATCH 3/3] Run ktlint --- .../domain/referendum/tindergov/TinderGovInteractor.kt | 2 -- .../presentation/referenda/list/ReferendaListViewModel.kt | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/TinderGovInteractor.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/TinderGovInteractor.kt index ca594501f8..9ed15518eb 100644 --- a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/TinderGovInteractor.kt +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/domain/referendum/tindergov/TinderGovInteractor.kt @@ -19,8 +19,6 @@ import io.novafoundation.nova.feature_governance_impl.domain.referendum.details. import io.novafoundation.nova.feature_governance_impl.domain.referendum.list.ReferendaSharedComputation import io.novafoundation.nova.feature_governance_impl.domain.referendum.list.filtering.ReferendaFilteringProvider import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.StartStakingLandingValidationSystem -import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.StartSwipeGovValidationFailure -import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.StartSwipeGovValidationPayload import io.novafoundation.nova.feature_governance_impl.domain.referendum.tindergov.validation.startSwipeGovValidation import io.novafoundation.nova.feature_wallet_api.domain.AssetUseCase import io.novafoundation.nova.feature_wallet_api.domain.getCurrentAsset diff --git a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt index 2ae22f6eb8..e04028a84e 100644 --- a/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt +++ b/feature-governance-impl/src/main/java/io/novafoundation/nova/feature_governance_impl/presentation/referenda/list/ReferendaListViewModel.kt @@ -16,7 +16,6 @@ import io.novafoundation.nova.common.utils.formatting.format import io.novafoundation.nova.common.utils.inBackground import io.novafoundation.nova.common.utils.withItemScope import io.novafoundation.nova.common.validation.ValidationExecutor -import io.novafoundation.nova.common.validation.progressConsumer import io.novafoundation.nova.common.view.PlaceholderModel import io.novafoundation.nova.core.updater.UpdateSystem import io.novafoundation.nova.feature_account_api.domain.interfaces.SelectedAccountUseCase @@ -74,7 +73,8 @@ class ReferendaListViewModel( private val tinderGovInteractor: TinderGovInteractor, private val selectedMetaAccountUseCase: SelectedAccountUseCase, private val validationExecutor: ValidationExecutor, -) : BaseViewModel(), WithAssetSelector, +) : BaseViewModel(), + WithAssetSelector, Validatable by validationExecutor { override val assetSelectorMixin = assetSelectorFactory.create(