Updated on 2026-08-14
This commit is contained in:
parent
e04ac1fb2c
commit
99d32963b5
20 changed files with 336 additions and 27 deletions
|
|
@ -182,7 +182,8 @@ internal class StakingModel @Inject constructor(
|
|||
}
|
||||
StakingIntegrationID.P2PEthPool -> {
|
||||
val vaults = p2pEthPoolRepository.getVaultsSync()
|
||||
P2PEthPoolIntegration(integrationId, vaults)
|
||||
val limits = p2pEthPoolRepository.getVaultLimitsSyncOrNull().orEmpty()
|
||||
P2PEthPoolIntegration(integrationId, vaults, limits)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ internal sealed class StakingStates {
|
|||
val yieldBalance: InnerYieldBalanceState,
|
||||
val pullToRefreshConfig: PullToRefreshConfig,
|
||||
val legalUrls: LegalUrls,
|
||||
val areAllTargetsFull: Boolean = false,
|
||||
) : InitialInfoState()
|
||||
|
||||
data class LegalUrls(
|
||||
|
|
|
|||
|
|
@ -166,7 +166,11 @@ internal class SetButtonsStateTransformer(
|
|||
val hasNotStaking = initialState?.yieldBalance == InnerYieldBalanceState.Empty
|
||||
val isCardano = BlockchainUtils.isCardano(cryptoCurrencyBlockchainId)
|
||||
|
||||
return !hasNotStaking && isCardano && currentStep == StakingStep.InitialInfo
|
||||
if (!hasNotStaking && isCardano && currentStep == StakingStep.InitialInfo) return true
|
||||
|
||||
val hasStaking = initialState?.yieldBalance is InnerYieldBalanceState.Data
|
||||
val areAllTargetsFull = initialState?.areAllTargetsFull == true
|
||||
return hasStaking && areAllTargetsFull && currentStep == StakingStep.InitialInfo
|
||||
}
|
||||
|
||||
private fun StakingUiState.isApprovalRequired(): Boolean {
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ internal class SetInitialDataStateTransformer(
|
|||
termsOfServiceUrl = integration.legalUrls.termsOfServiceUrl,
|
||||
privacyPolicyUrl = integration.legalUrls.privacyPolicyUrl,
|
||||
),
|
||||
areAllTargetsFull = integration.areAllTargetsFull,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ internal class StakingModelTransactionTest : StakingModelTestBase() {
|
|||
integrationId = StakingIntegrationID.P2PEthPool,
|
||||
)
|
||||
coEvery { p2pEthPoolRepository.getVaultsSync() } returns emptyList()
|
||||
coEvery { p2pEthPoolRepository.getVaultLimitsSyncOrNull() } returns emptyMap()
|
||||
val uiStateFlow = MutableStateFlow(initialUiState)
|
||||
every { stateController.uiState } returns uiStateFlow
|
||||
coEvery {
|
||||
|
|
@ -218,6 +219,7 @@ internal class StakingModelTransactionTest : StakingModelTestBase() {
|
|||
integrationId = StakingIntegrationID.P2PEthPool,
|
||||
)
|
||||
coEvery { p2pEthPoolRepository.getVaultsSync() } returns emptyList()
|
||||
coEvery { p2pEthPoolRepository.getVaultLimitsSyncOrNull() } returns emptyMap()
|
||||
val uiStateFlow = MutableStateFlow(initialUiState)
|
||||
every { stateController.uiState } returns uiStateFlow
|
||||
coEvery {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue