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:
2026-07-15 12:51:58 -07:00
parent 14c8b3c27c
commit cb8f0d8aae
4 changed files with 13 additions and 8 deletions
@@ -59,8 +59,9 @@ class BitcoinNativeAssetBalance(
chainAsset: Chain.Asset, chainAsset: Chain.Asset,
accountId: AccountId, accountId: AccountId,
): Flow<TransferableBalanceUpdatePoint> { ): Flow<TransferableBalanceUpdatePoint> {
// Not on the critical sync path (mirrors TronNativeAssetBalance/EvmNativeAssetBalance) - out of scope for Phase 4. // Only ever invoked from RealCrossChainTransactor (XCM arrival detection), which is Substrate-only -
TODO("Not yet implemented") // 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( override suspend fun startSyncingBalance(
@@ -63,7 +63,10 @@ class EvmNativeAssetBalance(
chainAsset: Chain.Asset, chainAsset: Chain.Asset,
accountId: AccountId, accountId: AccountId,
): Flow<TransferableBalanceUpdatePoint> { ): 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( override suspend fun startSyncingBalance(
@@ -62,8 +62,9 @@ class Trc20AssetBalance(
chainAsset: Chain.Asset, chainAsset: Chain.Asset,
accountId: AccountId, accountId: AccountId,
): Flow<TransferableBalanceUpdatePoint> { ): Flow<TransferableBalanceUpdatePoint> {
// Not on the critical sync path (mirrors EvmNativeAssetBalance) - out of scope for Phase 1 read-only support. // Only ever invoked from RealCrossChainTransactor (XCM arrival detection), which is Substrate-only -
TODO("Not yet implemented") // 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( override suspend fun startSyncingBalance(
@@ -59,9 +59,9 @@ class TronNativeAssetBalance(
chainAsset: Chain.Asset, chainAsset: Chain.Asset,
accountId: AccountId, accountId: AccountId,
): Flow<TransferableBalanceUpdatePoint> { ): Flow<TransferableBalanceUpdatePoint> {
// Not on the critical sync path (mirrors EvmNativeAssetBalance, which also leaves this unimplemented) - // Only ever invoked from RealCrossChainTransactor (XCM arrival detection), which is Substrate-only -
// out of scope for Phase 1 read-only support. // Tron can never be an XCM cross-chain destination, so this is intentionally never reachable.
TODO("Not yet implemented") throw UnsupportedOperationException("Tron does not support XCM-style balance update points")
} }
override suspend fun startSyncingBalance( override suspend fun startSyncingBalance(