diff --git a/Cargo.lock b/Cargo.lock index 54f0e65bd6d0..d6f741a2625b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -782,6 +782,7 @@ dependencies = [ "sp-runtime", "staging-xcm", "staging-xcm-executor", + "xcm-runtime-apis", ] [[package]] diff --git a/cumulus/parachains/integration-tests/emulated/common/src/macros.rs b/cumulus/parachains/integration-tests/emulated/common/src/macros.rs index 2107b5e3427c..b01a931a6696 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/macros.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/macros.rs @@ -464,12 +464,23 @@ macro_rules! test_xcm_fee_querying_apis_work_for_asset_hub { type Assets = <$asset_hub as [<$asset_hub Pallet>]>::Assets; type AssetConversion = <$asset_hub as [<$asset_hub Pallet>]>::AssetConversion; let wnd = Location::new(1, []); + let wnd_v3 = xcm::v3::Location::parent(); let usdt = Location::new(0, [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(USDT_ID.into())]); + let usdt_v3: xcm::v3::Location = (xcm::v3::Junction::PalletInstance(ASSETS_PALLET_ID), xcm::v3::Junction::GeneralIndex(USDT_ID.into())).into(); let sender = [<$asset_hub Sender>]::get(); + // We create USDT if it doesn't exist. + let _ = Assets::force_create( + RuntimeOrigin::root(), + USDT_ID.into(), + sender.clone().into(), + false, + 1, + ); + // Then we can create a pool with WND. assert_ok!(AssetConversion::create_pool( RuntimeOrigin::signed(sender.clone()), - Box::new(wnd.clone()), - Box::new(usdt.clone()), + Box::new(wnd_v3), + Box::new(usdt_v3), )); type Runtime = <$asset_hub as Chain>::Runtime; @@ -502,8 +513,8 @@ macro_rules! test_xcm_fee_querying_apis_work_for_asset_hub { // We make 1 WND = 4 USDT. assert_ok!(AssetConversion::add_liquidity( RuntimeOrigin::signed(sender.clone()), - Box::new(wnd), - Box::new(usdt.clone()), + Box::new(wnd_v3), + Box::new(usdt_v3), 1_000_000_000_000, 4_000_000_000_000, 0, diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/Cargo.toml index f7f8f64f0eb3..a1aa6ed2bb0f 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/Cargo.toml @@ -35,3 +35,4 @@ parachains-common.workspace = true parachains-common.default-features = true emulated-integration-tests-common.workspace = true rococo-system-emulated-network.workspace = true +xcm-runtime-apis.workspace = true diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs index 48f8c7a9d5c4..4a83e65bcfc0 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs @@ -35,8 +35,8 @@ mod imports { // Cumulus pub use asset_test_utils::xcm_helpers; pub use emulated_integration_tests_common::{ - test_parachain_is_trusted_teleporter, test_parachain_is_trusted_teleporter_for_relay, - test_relay_is_trusted_teleporter, test_xcm_fee_querying_apis_work_for_asset_hub, + test_parachain_is_trusted_teleporter, + test_xcm_fee_querying_apis_work_for_asset_hub, xcm_emulator::{ assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, TestContext, TestExt, diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs index ab7d1618b145..a06797993859 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/lib.rs @@ -35,8 +35,8 @@ mod imports { // Cumulus pub use asset_test_utils::xcm_helpers; pub use emulated_integration_tests_common::{ - test_parachain_is_trusted_teleporter, test_parachain_is_trusted_teleporter_for_relay, - test_relay_is_trusted_teleporter, test_xcm_fee_querying_apis_work_for_asset_hub, + test_parachain_is_trusted_teleporter, + test_xcm_fee_querying_apis_work_for_asset_hub, xcm_emulator::{ assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, TestContext, TestExt, diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index 02c209dcdbb5..ed1141a68eb9 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -1360,7 +1360,7 @@ impl_runtime_apis! { Err(XcmPaymentApiError::AssetNotFound) } }, - Ok(xcm::v3::AssetId::Abstract(_)) | Err(_) => { + Err(_) => { log::trace!(target: "xcm::xcm_runtime_apis", "query_weight_to_asset_fee - failed to convert asset: {asset:?}!"); Err(XcmPaymentApiError::VersionedConversionFailed) } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 239ca4742407..ba7cf6528422 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -1388,7 +1388,7 @@ impl_runtime_apis! { Err(XcmPaymentApiError::AssetNotFound) } }, - Ok(xcm::v3::AssetId::Abstract(_)) | Err(_) => { + Err(_) => { log::trace!(target: "xcm::xcm_runtime_apis", "query_weight_to_asset_fee - failed to convert asset: {asset:?}!"); Err(XcmPaymentApiError::VersionedConversionFailed) }