mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-22 13:45:48 +00:00
debug: log Tron chain arrival + gate evaluation in BalancesUpdateSystem
TRX is completely absent from the Assets list even for a brand-new wallet on a completely fresh install - ruled out per-account backfill (fresh wallet correctly derives tronAddress) and stale per-device chain state (fresh install, no carried-over connectionState). Need to see empirically whether the Tron chain even reaches currentChains at all, and if so, which of hasAccountIn/connectionState.isDisabled gates it.
This commit is contained in:
+12
@@ -39,12 +39,24 @@ class BalancesUpdateSystem(
|
||||
override fun start(): Flow<Updater.SideEffect> {
|
||||
return accountUpdateScope.invalidationFlow().flatMapLatest { metaAccount ->
|
||||
chainRegistry.currentChains.transformLatestDiffed { chain ->
|
||||
if (chain.isTronBased) {
|
||||
Log.d(LOG_TAG, "TronDebug: currentChains delivered chain=${chain.id} name=${chain.name}")
|
||||
}
|
||||
emitAll(balancesSync(chain, metaAccount))
|
||||
}
|
||||
}.flowOn(Dispatchers.Default)
|
||||
}
|
||||
|
||||
private suspend fun balancesSync(chain: Chain, metaAccount: MetaAccount): Flow<Updater.SideEffect> {
|
||||
if (chain.isTronBased) {
|
||||
Log.d(
|
||||
LOG_TAG,
|
||||
"TronDebug: gate check chain=${chain.id} name=${chain.name} hasAccountIn=${metaAccount.hasAccountIn(chain)} " +
|
||||
"connectionState=${chain.connectionState} isDisabled=${chain.connectionState.isDisabled} " +
|
||||
"hasSubstrateRuntime=${chain.hasSubstrateRuntime} canPerformFullSync=${chain.canPerformFullSync()}"
|
||||
)
|
||||
}
|
||||
|
||||
return when {
|
||||
!metaAccount.hasAccountIn(chain) -> emptyFlow()
|
||||
chain.connectionState.isDisabled -> emptyFlow()
|
||||
|
||||
Reference in New Issue
Block a user