mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-22 18:25:50 +00:00
Replace TODO("Not yet implemented") with an explicit UnsupportedOperationException
subscribeAccountBalanceUpdatePoint() on Bitcoin/Tron-native/TRC20/EVM-native balance sources is only ever called from RealCrossChainTransactor's XCM arrival detection, which is Substrate-only - none of these chain families can be an XCM cross-chain destination, so the method is intentionally never reachable. A bare TODO() reads as forgotten/unfinished work; swapping it for the same UnsupportedOperationException pattern UnsupportedAssetBalance already uses elsewhere in this codebase makes the same never-called guarantee explicit and documented instead of implicit.
This commit is contained in:
+3
-2
@@ -59,8 +59,9 @@ class BitcoinNativeAssetBalance(
|
||||
chainAsset: Chain.Asset,
|
||||
accountId: AccountId,
|
||||
): Flow<TransferableBalanceUpdatePoint> {
|
||||
// Not on the critical sync path (mirrors TronNativeAssetBalance/EvmNativeAssetBalance) - out of scope for Phase 4.
|
||||
TODO("Not yet implemented")
|
||||
// Only ever invoked from RealCrossChainTransactor (XCM arrival detection), which is Substrate-only -
|
||||
// Bitcoin can never be an XCM cross-chain destination, so this is intentionally never reachable.
|
||||
throw UnsupportedOperationException("Bitcoin does not support XCM-style balance update points")
|
||||
}
|
||||
|
||||
override suspend fun startSyncingBalance(
|
||||
|
||||
+4
-1
@@ -63,7 +63,10 @@ class EvmNativeAssetBalance(
|
||||
chainAsset: Chain.Asset,
|
||||
accountId: AccountId,
|
||||
): Flow<TransferableBalanceUpdatePoint> {
|
||||
TODO("Not yet implemented")
|
||||
// Only ever invoked from RealCrossChainTransactor (XCM arrival detection), which is Substrate-only -
|
||||
// an EVM chain's native asset can never be an XCM cross-chain destination, so this is intentionally
|
||||
// never reachable.
|
||||
throw UnsupportedOperationException("EVM native assets do not support XCM-style balance update points")
|
||||
}
|
||||
|
||||
override suspend fun startSyncingBalance(
|
||||
|
||||
+3
-2
@@ -62,8 +62,9 @@ class Trc20AssetBalance(
|
||||
chainAsset: Chain.Asset,
|
||||
accountId: AccountId,
|
||||
): Flow<TransferableBalanceUpdatePoint> {
|
||||
// Not on the critical sync path (mirrors EvmNativeAssetBalance) - out of scope for Phase 1 read-only support.
|
||||
TODO("Not yet implemented")
|
||||
// Only ever invoked from RealCrossChainTransactor (XCM arrival detection), which is Substrate-only -
|
||||
// Tron/TRC20 can never be an XCM cross-chain destination, so this is intentionally never reachable.
|
||||
throw UnsupportedOperationException("TRC20 does not support XCM-style balance update points")
|
||||
}
|
||||
|
||||
override suspend fun startSyncingBalance(
|
||||
|
||||
+3
-3
@@ -59,9 +59,9 @@ class TronNativeAssetBalance(
|
||||
chainAsset: Chain.Asset,
|
||||
accountId: AccountId,
|
||||
): Flow<TransferableBalanceUpdatePoint> {
|
||||
// Not on the critical sync path (mirrors EvmNativeAssetBalance, which also leaves this unimplemented) -
|
||||
// out of scope for Phase 1 read-only support.
|
||||
TODO("Not yet implemented")
|
||||
// Only ever invoked from RealCrossChainTransactor (XCM arrival detection), which is Substrate-only -
|
||||
// Tron can never be an XCM cross-chain destination, so this is intentionally never reachable.
|
||||
throw UnsupportedOperationException("Tron does not support XCM-style balance update points")
|
||||
}
|
||||
|
||||
override suspend fun startSyncingBalance(
|
||||
|
||||
Reference in New Issue
Block a user