From 1830024ed08a3ca43e4a2841e9f9c616f3523f0c Mon Sep 17 00:00:00 2001 From: Satoshi Qazi Muhammed Date: Sun, 12 Jul 2026 15:07:30 -0700 Subject: [PATCH] fix: add BitcoinNative branch to exhaustive Chain.Asset.Type whens CI caught onChainAssetId's when as non-exhaustive; a codebase-wide sweep for every other exhaustive when on Chain.Asset.Type found one more (existentialDepositError in Common.kt) that would have failed the same way. --- .../network/blockchain/assets/transfers/validations/Common.kt | 1 + .../src/main/java/io/novafoundation/nova/runtime/ext/ChainExt.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/feature-wallet-impl/src/main/java/io/novafoundation/nova/feature_wallet_impl/data/network/blockchain/assets/transfers/validations/Common.kt b/feature-wallet-impl/src/main/java/io/novafoundation/nova/feature_wallet_impl/data/network/blockchain/assets/transfers/validations/Common.kt index 5fc78510..e886ebdf 100644 --- a/feature-wallet-impl/src/main/java/io/novafoundation/nova/feature_wallet_impl/data/network/blockchain/assets/transfers/validations/Common.kt +++ b/feature-wallet-impl/src/main/java/io/novafoundation/nova/feature_wallet_impl/data/network/blockchain/assets/transfers/validations/Common.kt @@ -121,6 +121,7 @@ private fun Chain.Asset.existentialDepositError(amount: BigDecimal): WillRemoveA is Type.Statemine -> WillRemoveAccount.WillTransferDust(amount) is Type.EvmErc20, is Type.EvmNative -> WillRemoveAccount.WillBurnDust is Type.Trc20, Type.TronNative -> WillRemoveAccount.WillBurnDust + Type.BitcoinNative -> WillRemoveAccount.WillBurnDust is Type.Equilibrium -> WillRemoveAccount.WillBurnDust Type.Unsupported -> throw IllegalArgumentException("Unsupported") } diff --git a/runtime/src/main/java/io/novafoundation/nova/runtime/ext/ChainExt.kt b/runtime/src/main/java/io/novafoundation/nova/runtime/ext/ChainExt.kt index 909766a3..477d95e3 100644 --- a/runtime/src/main/java/io/novafoundation/nova/runtime/ext/ChainExt.kt +++ b/runtime/src/main/java/io/novafoundation/nova/runtime/ext/ChainExt.kt @@ -637,6 +637,7 @@ val Chain.Asset.onChainAssetId: String? is Type.EvmNative -> null is Type.Trc20 -> this.type.contractAddress Type.TronNative -> null + Type.BitcoinNative -> null Type.Unsupported -> error("Unsupported assetId type: ${this.type::class.simpleName}") }