From a693c4e7f3f1f56443cb1394df96f89b20634d0e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 13 Jan 2025 17:53:56 +0100 Subject: [PATCH 1/2] xcm: convert properly assets in xcmpayment apis --- polkadot/runtime/rococo/src/lib.rs | 3 ++- polkadot/runtime/westend/src/lib.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index cab4394eb5a8..fdb5b4dedd55 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -1885,7 +1885,8 @@ sp_api::impl_runtime_apis! { } fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result { - match asset.try_as::() { + let latest_asset_id: Result = asset.clone().try_into(); + match latest_asset_id { Ok(asset_id) if asset_id.0 == xcm_config::TokenLocation::get() => { // for native token Ok(WeightToFee::weight_to_fee(&weight)) diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 166f3fc42eef..48a11187881d 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -2445,7 +2445,8 @@ sp_api::impl_runtime_apis! { } fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result { - match asset.try_as::() { + let latest_asset_id: Result = asset.clone().try_into(); + match latest_asset_id { Ok(asset_id) if asset_id.0 == xcm_config::TokenLocation::get() => { // for native token Ok(WeightToFee::weight_to_fee(&weight)) From 228d757aa36c025927cab7cca42d78432707e3cd Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Tue, 14 Jan 2025 18:01:17 +0000 Subject: [PATCH 2/2] Update from franciscoaguirre running command 'prdoc --audience runtime_user --bump patch' --- prdoc/pr_7134.prdoc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 prdoc/pr_7134.prdoc diff --git a/prdoc/pr_7134.prdoc b/prdoc/pr_7134.prdoc new file mode 100644 index 000000000000..095d4757f438 --- /dev/null +++ b/prdoc/pr_7134.prdoc @@ -0,0 +1,11 @@ +title: 'xcm: convert properly assets in xcmpayment apis' +doc: +- audience: Runtime User + description: |- + Port #6459 changes to relays as well, which were probably forgotten in that PR. + Thanks! +crates: +- name: rococo-runtime + bump: patch +- name: westend-runtime + bump: patch