mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-06-13 04:41:10 +00:00
Fix cross-chain XCM config parsing for destination field
The XCM config JSON has a nested structure where chainId and assetId are inside a "destination" object, but the Kotlin class expected them at the root level. This was causing NullPointerException when parsing cross-chain transfer configurations. Changes: - Add XcmTransferDestinationRemote class to represent nested destination - Update DynamicXcmTransferRemote to use destination object instead of flat chainId/assetId fields - Update Dynamic.kt mapping to access transfer.destination.chainId/assetId This fixes cross-chain transfers between Pezkuwi, Pezkuwi Asset Hub, and Pezkuwi People chains. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -63,7 +63,10 @@ private fun constructTransfersForChain(configRemote: DynamicCrossChainOriginChai
|
||||
assetId = assetConfig.assetId,
|
||||
destinations = assetConfig.xcmTransfers.map { transfer ->
|
||||
TransferDestination(
|
||||
fullChainAssetId = FullChainAssetId(transfer.chainId, transfer.assetId),
|
||||
fullChainAssetId = FullChainAssetId(
|
||||
transfer.destination.chainId,
|
||||
transfer.destination.assetId
|
||||
),
|
||||
hasDeliveryFee = transfer.hasDeliveryFee ?: false,
|
||||
supportsXcmExecute = transfer.supportsXcmExecute ?: false,
|
||||
)
|
||||
|
||||
+7
-2
@@ -33,8 +33,13 @@ class DynamicCrossChainOriginAssetRemote(
|
||||
)
|
||||
|
||||
class DynamicXcmTransferRemote(
|
||||
val chainId: ChainId,
|
||||
val assetId: Int,
|
||||
val destination: XcmTransferDestinationRemote,
|
||||
val type: String?,
|
||||
val hasDeliveryFee: Boolean?,
|
||||
val supportsXcmExecute: Boolean?,
|
||||
)
|
||||
|
||||
class XcmTransferDestinationRemote(
|
||||
val chainId: ChainId,
|
||||
val assetId: Int,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user