mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-04-22 07:57:59 +00:00
fix: nomination pool exposure queries route to relay chain, graceful pending_rewards fallback
- StakeSummary and Alerts interactors now query elected exposures from relay chain (parentId) instead of parachain for correct staking status - Pending rewards flow catches missing NominationPoolsApi and emits zero - Update Telegram link to @pezkuwichainBot
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ android {
|
||||
buildConfigField "String", "PRIVACY_URL", "\"https://pezkuwichain.io/privacy.html\""
|
||||
buildConfigField "String", "TERMS_URL", "\"https://pezkuwichain.io/terms.html\""
|
||||
buildConfigField "String", "GITHUB_URL", "\"https://github.com/pezkuwichain\""
|
||||
buildConfigField "String", "TELEGRAM_URL", "\"https://t.me/pezkuwichain\""
|
||||
buildConfigField "String", "TELEGRAM_URL", "\"https://t.me/pezkuwichainBot\""
|
||||
buildConfigField "String", "TWITTER_URL", "\"https://twitter.com/pezkuwichain\""
|
||||
buildConfigField "String", "RATE_URL", "\"market://details?id=${rootProject.applicationId}.${releaseApplicationSuffix}\""
|
||||
buildConfigField "String", "EMAIL", "\"support@pezkuwichain.io\""
|
||||
|
||||
+3
-1
@@ -49,11 +49,13 @@ class RealNominationPoolsAlertsInteractor(
|
||||
return flowOfAll {
|
||||
val poolId = poolMember.poolId
|
||||
val poolStash = poolAccountDerivation.bondedAccountOf(poolId, chain.id)
|
||||
// Staking exposures live on the relay chain, not on parachains like Asset Hub
|
||||
val exposureChainId = chain.parentId ?: chain.id
|
||||
|
||||
combine(
|
||||
nominationPoolsSharedComputation.participatingPoolNominationsFlow(poolStash, poolId, chain.id, shareComputationScope),
|
||||
nominationPoolsSharedComputation.unbondingPoolsFlow(poolId, chain.id, shareComputationScope),
|
||||
stakingSharedComputation.electedExposuresWithActiveEraFlow(chain.id, shareComputationScope),
|
||||
stakingSharedComputation.electedExposuresWithActiveEraFlow(exposureChainId, shareComputationScope),
|
||||
) { poolNominations, unbondingPools, (eraStakers, activeEra) ->
|
||||
val alertsContext = AlertsResolutionContext(
|
||||
eraStakers = eraStakers,
|
||||
|
||||
+5
-2
@@ -47,13 +47,16 @@ class RealNominationPoolStakeSummaryInteractor(
|
||||
stakingOption: StakingOption,
|
||||
sharedComputationScope: CoroutineScope,
|
||||
): Flow<StakeSummary<PoolMemberStatus>> = flowOfAll {
|
||||
val chainId = stakingOption.assetWithChain.chain.id
|
||||
val chain = stakingOption.assetWithChain.chain
|
||||
val chainId = chain.id
|
||||
// Staking exposures live on the relay chain, not on parachains like Asset Hub
|
||||
val exposureChainId = chain.parentId ?: chainId
|
||||
val poolStash = poolAccountDerivation.bondedAccountOf(poolMember.poolId, chainId)
|
||||
|
||||
combineTransform(
|
||||
nominationPoolSharedComputation.participatingBondedPoolStateFlow(poolStash, poolMember.poolId, chainId, sharedComputationScope),
|
||||
nominationPoolSharedComputation.participatingPoolNominationsFlow(poolStash, poolMember.poolId, chainId, sharedComputationScope),
|
||||
stakingSharedComputation.electedExposuresWithActiveEraFlow(chainId, sharedComputationScope)
|
||||
stakingSharedComputation.electedExposuresWithActiveEraFlow(exposureChainId, sharedComputationScope)
|
||||
) { bondedPoolState, poolNominations, (eraStakers, activeEra) ->
|
||||
val activeStaked = bondedPoolState.amountOf(poolMember.points)
|
||||
|
||||
|
||||
+4
-1
@@ -52,6 +52,9 @@ class RealNominationPoolsUserRewardsInteractor(
|
||||
|
||||
private fun pendingRewardsFlow(accountId: AccountId, chainId: ChainId): Flow<Balance> {
|
||||
return flowOf { repository.getPendingRewards(accountId, chainId) }
|
||||
.catch { Log.e("NominationPoolsUserRewardsInteractor", "Failed to fetch pending rewards", it) }
|
||||
.catch {
|
||||
Log.e("NominationPoolsUserRewardsInteractor", "Failed to fetch pending rewards", it)
|
||||
emit(Balance.ZERO)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user