mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-22 18:25:50 +00:00
fix: apply the chain/asset-standard label to the main balance list too
The Send/Receive/etc. network picker (NetworkFlowViewModel) already showed "Ethereum (ERC-20)"/"Tron (TRC-20)" for a multi-chain token's per-chain rows, but the main Assets dashboard's own expandable per-token breakdown (tap a token like USDT to see every chain it exists on) is a completely separate code path (TokenAssetMappers/TokenAssetViewHolder) that still showed a bare chain name - found via a real device screenshot of that specific screen. Moved the shared display-name-with-label logic to a public extension (Chain.displayNameWithAssetStandard(), runtime/ext/ChainExt.kt) so both screens build the exact same string instead of duplicating (and now diverging) the same logic twice.
This commit is contained in:
@@ -515,6 +515,18 @@ val Chain.assetStandardLabelOrNull: String?
|
||||
else -> null
|
||||
}
|
||||
|
||||
/**
|
||||
* Chain display name with its token-standard label appended where [assetStandardLabelOrNull] applies, e.g.
|
||||
* "Ethereum (ERC-20)". Shared across every screen that lists the same token symbol once per chain (the
|
||||
* Send/Receive/etc. network picker, the main balance list's per-token chain breakdown) - a bare chain name
|
||||
* alone doesn't convey which issuance this is when multiple ecosystems share the same symbol.
|
||||
*/
|
||||
fun Chain.displayNameWithAssetStandard(): String {
|
||||
val standardLabel = assetStandardLabelOrNull ?: return name
|
||||
|
||||
return "$name ($standardLabel)"
|
||||
}
|
||||
|
||||
fun Chain.Asset.requireStatemine(): Type.Statemine {
|
||||
require(type is Type.Statemine)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user