diff --git a/build.gradle b/build.gradle index 927170fa5d..e6d337163a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ buildscript { ext { // App version - versionName = '9.0.0' - versionCode = 158 + versionName = '9.0.1' + versionCode = 159 applicationId = "io.novafoundation.nova" releaseApplicationSuffix = "market" diff --git a/feature-assets/src/main/java/io/novafoundation/nova/feature_assets/presentation/balance/common/BalanceListAdapter.kt b/feature-assets/src/main/java/io/novafoundation/nova/feature_assets/presentation/balance/common/BalanceListAdapter.kt index c6ab404aa6..9cac4ef514 100644 --- a/feature-assets/src/main/java/io/novafoundation/nova/feature_assets/presentation/balance/common/BalanceListAdapter.kt +++ b/feature-assets/src/main/java/io/novafoundation/nova/feature_assets/presentation/balance/common/BalanceListAdapter.kt @@ -87,7 +87,7 @@ class BalanceListAdapter( val item = getItem(position) as TokenAssetUi resolvePayload(holder, position, payloads) { when (it) { - AssetModel::amount -> holder.bindTotal(item.asset) + amountExtractor -> holder.bindTotal(item.asset) } } } diff --git a/runtime/src/main/java/io/novafoundation/nova/runtime/multiNetwork/multiLocation/MultiLocationEncoding.kt b/runtime/src/main/java/io/novafoundation/nova/runtime/multiNetwork/multiLocation/MultiLocationEncoding.kt index f30fe143d7..873e45932a 100644 --- a/runtime/src/main/java/io/novafoundation/nova/runtime/multiNetwork/multiLocation/MultiLocationEncoding.kt +++ b/runtime/src/main/java/io/novafoundation/nova/runtime/multiNetwork/multiLocation/MultiLocationEncoding.kt @@ -37,17 +37,23 @@ private fun bindInterior(instance: Any?): MultiLocation.Interior { return when (asDictEnum.name) { "Here" -> MultiLocation.Interior.Here - "X1" -> { - val junction = bindJunction(asDictEnum.value) - MultiLocation.Interior.Junctions(listOf(junction)) - } + else -> { - val junctions = bindList(asDictEnum.value, ::bindJunction) + val junctions = bindJunctions(asDictEnum.value) MultiLocation.Interior.Junctions(junctions) } } } +private fun bindJunctions(instance: Any?): List { + // Note that Interior.X1 is encoded differently in XCM v3 (a single junction) and V4 (single-element list) + if (instance is List<*>) { + return bindList(instance, ::bindJunction) + } else { + return listOf(bindJunction(instance)) + } +} + private fun bindJunction(instance: Any?): Junction { val asDictEnum = instance.castToDictEnum() @@ -56,6 +62,7 @@ private fun bindJunction(instance: Any?): Junction { val keyBytes = bindByteArray(asDictEnum.value) Junction.GeneralKey(keyBytes.toHexString(withPrefix = true)) } + "PalletInstance" -> Junction.PalletInstance(bindNumber(asDictEnum.value)) "Parachain" -> Junction.ParachainId(bindNumber(asDictEnum.value)) "GeneralIndex" -> Junction.GeneralIndex(bindNumber(asDictEnum.value)) @@ -81,6 +88,7 @@ private fun bindGlobalConsensusJunction(instance: Any?): Junction { val genesis = bindByteArray(asDictEnum.value).toHexString(withPrefix = false) Junction.GlobalConsensus(chainId = genesis) } + "Polkadot" -> Junction.GlobalConsensus(chainId = Chain.Geneses.POLKADOT) "Kusama" -> Junction.GlobalConsensus(chainId = Chain.Geneses.KUSAMA) "Westend" -> Junction.GlobalConsensus(chainId = Chain.Geneses.WESTEND)