From fb90328296733d52e2d8e1aaa92ac7723775f3d5 Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Mon, 4 Mar 2024 11:43:23 +0100 Subject: [PATCH 1/8] feat(pallet-xcm): bump version --- Cargo.lock | 8 ++++---- chain-spec-generator/Cargo.toml | 2 +- relay/kusama/Cargo.toml | 4 ++-- relay/kusama/src/weights/pallet_xcm.rs | 3 +++ relay/polkadot/Cargo.toml | 4 ++-- relay/polkadot/src/weights/pallet_xcm.rs | 3 +++ system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml | 4 ++-- .../asset-hubs/asset-hub-kusama/primitives/Cargo.toml | 2 +- .../asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs | 3 +++ .../asset-hubs/asset-hub-polkadot/Cargo.toml | 4 ++-- .../asset-hubs/asset-hub-polkadot/primitives/Cargo.toml | 2 +- .../asset-hub-polkadot/src/weights/pallet_xcm.rs | 3 +++ .../bridge-hubs/bridge-hub-kusama/Cargo.toml | 4 ++-- .../bridge-hub-kusama/src/weights/pallet_xcm.rs | 3 +++ .../bridge-hubs/bridge-hub-polkadot/Cargo.toml | 4 ++-- .../bridge-hub-polkadot/src/weights/pallet_xcm.rs | 3 +++ .../collectives/collectives-polkadot/Cargo.toml | 4 ++-- .../collectives-polkadot/src/weights/pallet_xcm.rs | 3 +++ system-parachains/encointer/Cargo.toml | 4 ++-- system-parachains/gluttons/glutton-kusama/Cargo.toml | 2 +- 20 files changed, 45 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ad0c414e0..d2d5a6d2a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8005,9 +8005,9 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "8.0.1" +version = "8.0.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2b0bade2eb6ce40af35a5af150692b4e150638f7f68c15735ab9cdf79650d68e" +checksum = "d32aa4911002f03a8aebd897e094980e7a9fb25d092e0f8db38e76e1e4f643ee" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -13313,9 +13313,9 @@ dependencies = [ [[package]] name = "staging-xcm" -version = "8.0.0" +version = "8.0.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "5ccecaeae5eca8453760e96fcf65481b19898459971842004732e88cd3570741" +checksum = "48fa328b87de3466bc38cc9a07244c42c647b7755b81115e1dfeb47cc13fc6e6" dependencies = [ "array-bytes 6.2.2", "bounded-collections", diff --git a/chain-spec-generator/Cargo.toml b/chain-spec-generator/Cargo.toml index 11332421b3..017285b77b 100644 --- a/chain-spec-generator/Cargo.toml +++ b/chain-spec-generator/Cargo.toml @@ -26,7 +26,7 @@ pallet-staking = "29.0.0" sc-consensus-grandpa = "0.20.0" sp-runtime = "32.0.0" sp-consensus-beefy = "14.0.0" -xcm = { package = "staging-xcm", version = "8.0.0" } +xcm = { package = "staging-xcm", version = "8.0.1" } parachains-common = { version = "8.0.0" } cumulus-primitives-core = { version = "0.8.0" } diff --git a/relay/kusama/Cargo.toml b/relay/kusama/Cargo.toml index 2a41407b8a..e05924df6b 100644 --- a/relay/kusama/Cargo.toml +++ b/relay/kusama/Cargo.toml @@ -81,7 +81,7 @@ pallet-treasury = { default-features = false , version = "28.0.0" } pallet-utility = { default-features = false , version = "29.0.0" } pallet-vesting = { default-features = false , version = "29.0.0" } pallet-whitelist = { default-features = false , version = "28.0.0" } -pallet-xcm = { default-features = false , version = "8.0.1" } +pallet-xcm = { default-features = false , version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } frame-election-provider-support = { default-features = false , version = "29.0.0" } @@ -98,7 +98,7 @@ runtime-common = { package = "polkadot-runtime-common", default-features = false runtime-parachains = { package = "polkadot-runtime-parachains", default-features = false , version = "8.0.1" } primitives = { package = "polkadot-primitives", default-features = false , version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false , version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false , version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "8.0.1" } diff --git a/relay/kusama/src/weights/pallet_xcm.rs b/relay/kusama/src/weights/pallet_xcm.rs index 027570ad3e..8a0ea074ee 100644 --- a/relay/kusama/src/weights/pallet_xcm.rs +++ b/relay/kusama/src/weights/pallet_xcm.rs @@ -51,6 +51,9 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + todo!() + } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `XcmPallet::SupportedVersion` (r:1 w:0) diff --git a/relay/polkadot/Cargo.toml b/relay/polkadot/Cargo.toml index 5a363430fb..27a5a40f2e 100644 --- a/relay/polkadot/Cargo.toml +++ b/relay/polkadot/Cargo.toml @@ -79,7 +79,7 @@ pallet-whitelist = { default-features = false , version = "28.0.0" } pallet-vesting = { default-features = false , version = "29.0.0" } pallet-utility = { default-features = false , version = "29.0.0" } frame-election-provider-support = { default-features = false , version = "29.0.0" } -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } frame-benchmarking = { default-features = false, optional = true , version = "29.0.0" } @@ -94,7 +94,7 @@ runtime-common = { package = "polkadot-runtime-common", default-features = false runtime-parachains = { package = "polkadot-runtime-parachains", default-features = false , version = "8.0.1" } primitives = { package = "polkadot-primitives", default-features = false , version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false , version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false , version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "8.0.1" } diff --git a/relay/polkadot/src/weights/pallet_xcm.rs b/relay/polkadot/src/weights/pallet_xcm.rs index 3e82626c00..dd0e99b5f3 100644 --- a/relay/polkadot/src/weights/pallet_xcm.rs +++ b/relay/polkadot/src/weights/pallet_xcm.rs @@ -51,6 +51,9 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + todo!() + } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `XcmPallet::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index 2a773ae560..4e062aed53 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -67,12 +67,12 @@ sp-weights = { default-features = false, version = "28.0.0" } primitive-types = { version = "0.12.2", default-features = false, features = ["codec", "scale-info", "num-traits"] } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml index 26b0c80801..102c205335 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/primitives/Cargo.toml @@ -19,7 +19,7 @@ frame-support = { default-features = false, version = "29.0.0" } sp-std = { default-features = false, version = "14.0.0" } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } [features] default = [ "std" ] diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs index 8832066a4c..90c760d32f 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs @@ -47,6 +47,9 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + todo!() + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml index 62e8223ff0..2c2affff30 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml @@ -62,12 +62,12 @@ sp-version = { default-features = false, version = "30.0.0" } sp-weights = { default-features = false, version = "28.0.0" } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml b/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml index e049be2504..8fd8267b69 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-polkadot/primitives/Cargo.toml @@ -19,7 +19,7 @@ frame-support = { default-features = false, version = "29.0.0" } sp-std = { default-features = false, version = "14.0.0" } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } [features] default = [ "std" ] diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs index 8cbf8e7f4f..65e292b239 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs @@ -47,6 +47,9 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + todo!() + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index c8dcfc8aca..6b5ba3f8c1 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -60,12 +60,12 @@ sp-transaction-pool = { default-features = false, version = "27.0.0" } sp-version = { default-features = false, version = "30.0.0" } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs index 82bed2b1fb..7f8f99c6f5 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs @@ -47,6 +47,9 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + todo!() + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml index 3d5dcdf978..9299cd55b3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml @@ -60,12 +60,12 @@ sp-transaction-pool = { default-features = false, version = "27.0.0" } sp-version = { default-features = false, version = "30.0.0" } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } pallet-xcm-benchmarks = { default-features = false, optional = true , version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs index abdccc9ca0..748f0b5ba0 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs @@ -47,6 +47,9 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + todo!() + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/collectives/collectives-polkadot/Cargo.toml b/system-parachains/collectives/collectives-polkadot/Cargo.toml index 2f1e0ec511..4f471ef555 100644 --- a/system-parachains/collectives/collectives-polkadot/Cargo.toml +++ b/system-parachains/collectives/collectives-polkadot/Cargo.toml @@ -59,12 +59,12 @@ sp-transaction-pool = { default-features = false, version = "27.0.0" } sp-version = { default-features = false, version = "30.0.0" } # Polkadot -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } polkadot-core-primitives = { default-features = false, version = "8.0.0" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } polkadot-runtime-constants = { path = "../../../relay/polkadot/constants", default-features = false} -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs index 96a89b0292..9e7772d486 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs @@ -47,6 +47,9 @@ use core::marker::PhantomData; /// Weight functions for `pallet_xcm`. pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { + fn claim_assets() -> Weight { + todo!() + } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) diff --git a/system-parachains/encointer/Cargo.toml b/system-parachains/encointer/Cargo.toml index 80e9012b40..5a2c3bc633 100644 --- a/system-parachains/encointer/Cargo.toml +++ b/system-parachains/encointer/Cargo.toml @@ -71,10 +71,10 @@ sp-version = { default-features = false, version = "30.0.0" } sp-genesis-builder = { default-features = false, version = "0.8.0" } # Polkadot dependencies -pallet-xcm = { default-features = false, version = "8.0.1" } +pallet-xcm = { default-features = false, version = "8.0.2" } polkadot-parachain-primitives = { default-features = false, version = "7.0.0" } polkadot-runtime-common = { default-features = false, version = "8.0.1" } -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } diff --git a/system-parachains/gluttons/glutton-kusama/Cargo.toml b/system-parachains/gluttons/glutton-kusama/Cargo.toml index 7a0dd078ca..5473fffcfd 100644 --- a/system-parachains/gluttons/glutton-kusama/Cargo.toml +++ b/system-parachains/gluttons/glutton-kusama/Cargo.toml @@ -37,7 +37,7 @@ sp-transaction-pool = { default-features = false, version = "27.0.0" } sp-version = { default-features = false, version = "30.0.0" } # Polkadot -xcm = { package = "staging-xcm", default-features = false, version = "8.0.0" } +xcm = { package = "staging-xcm", default-features = false, version = "8.0.1" } xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } From 50b6e522831680710b0960f295e24b81fe904195 Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Mon, 4 Mar 2024 11:43:51 +0100 Subject: [PATCH 2/8] feat(claim_assets): add a test for claim_assets in all runtimes --- integration-tests/emulated/helpers/Cargo.toml | 4 +- integration-tests/emulated/helpers/src/lib.rs | 56 ++++++++++++++++++- .../tests/assets/asset-hub-kusama/Cargo.toml | 4 +- .../assets/asset-hub-kusama/src/tests/mod.rs | 12 ++++ .../assets/asset-hub-polkadot/Cargo.toml | 4 +- .../asset-hub-polkadot/src/tests/mod.rs | 12 ++++ .../bridges/bridge-hub-kusama/Cargo.toml | 4 +- .../bridge-hub-kusama/src/tests/mod.rs | 12 ++++ .../bridges/bridge-hub-polkadot/Cargo.toml | 4 +- .../bridge-hub-polkadot/src/tests/mod.rs | 12 ++++ 10 files changed, 113 insertions(+), 11 deletions(-) diff --git a/integration-tests/emulated/helpers/Cargo.toml b/integration-tests/emulated/helpers/Cargo.toml index b486f9c160..b902647565 100644 --- a/integration-tests/emulated/helpers/Cargo.toml +++ b/integration-tests/emulated/helpers/Cargo.toml @@ -15,8 +15,8 @@ pallet-balances = { version = "29.0.0" } pallet-message-queue = { version = "32.0.0" } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.0" } -pallet-xcm = { version = "8.0.1" } +xcm = { package = "staging-xcm", version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } # Cumulus xcm-emulator = { version = "0.6.0" } diff --git a/integration-tests/emulated/helpers/src/lib.rs b/integration-tests/emulated/helpers/src/lib.rs index dabe978312..438f320cfa 100644 --- a/integration-tests/emulated/helpers/src/lib.rs +++ b/integration-tests/emulated/helpers/src/lib.rs @@ -21,7 +21,7 @@ pub use pallet_message_queue; // Polkadot pub use pallet_xcm; -pub use xcm::prelude::{AccountId32, WeightLimit}; +pub use xcm::prelude::{AccountId32, VersionedAssets, Weight, WeightLimit}; // Cumulus pub use asset_test_utils; @@ -122,3 +122,57 @@ macro_rules! test_parachain_is_trusted_teleporter { } }; } + +#[macro_export] +macro_rules! test_parachain_can_claim_assets { + ( $sender_para:ty, $runtime_call:ty, $network_id:expr, $assets:expr, $amount:expr ) => { + $crate::paste::paste! { + let sender = [<$sender_para Sender>]::get(); + let origin = <$sender_para as $crate::Chain>::RuntimeOrigin::signed(sender.clone()); + // Receiver is the same as sender + let beneficiary: Location = + $crate::AccountId32 { network: Some($network_id), id: sender.clone().into() }.into(); + let versioned_assets: $crate::VersionedAssets = $assets.clone().into(); + + <$sender_para>::execute_with(|| { + // Assets are trapped for whatever reason. + // The possible reasons for this might differ from runtime to runtime, so here we just drop them directly. + <$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::drop_assets( + &beneficiary, + $assets.into(), + &XcmContext { origin: None, message_id: [0u8; 32], topic: None }, + ); + + type RuntimeEvent = <$sender_para as $crate::Chain>::RuntimeEvent; + assert_expected_events!( + $sender_para, + vec![ + RuntimeEvent::PolkadotXcm( + $crate::pallet_xcm::Event::AssetsTrapped { origin: beneficiary, assets: versioned_assets, .. } + ) => {}, + ] + ); + + let balance_before = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&sender); + + assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + origin.clone(), + bx!(versioned_assets.clone().into()), + bx!(beneficiary.clone().into()), + )); + + assert_expected_events!( + $sender_para, + vec![ + RuntimeEvent::PolkadotXcm( + $crate::pallet_xcm::Event::AssetsClaimed { origin: beneficiary, assets: versioned_assets, .. } + ) => {}, + ] + ); + + let balance_after = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&sender); + assert_eq!(balance_after, balance_before + $amount); + }); + } + }; +} diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml index 866b6c5840..14228e387d 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/Cargo.toml @@ -20,9 +20,9 @@ pallet-asset-conversion = { version = "11.0.0" } pallet-message-queue = { version = "32.0.0" } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.0" } +xcm = { package = "staging-xcm", version = "8.0.1" } xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "8.0.1" } -pallet-xcm = { version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } # Cumulus parachains-common = { version = "8.0.0" } diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs index 4b7498c1c6..5c528c5401 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs @@ -26,3 +26,15 @@ emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_ KUSAMA_ED, system_parachains_constants::kusama::fee::WeightToFee ); + +#[test] +fn assets_can_be_claimed() { + use asset_hub_kusama_runtime::ExistentialDeposit; + use integration_tests_helpers::test_parachain_can_claim_assets; + use xcm_executor::traits::DropAssets; + + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_parachain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); +} diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml index 77b977f577..ce1a8587cf 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/Cargo.toml @@ -21,8 +21,8 @@ pallet-message-queue = { version = "32.0.0" } # Polkadot polkadot-runtime-common = { version = "8.0.1" } -xcm = { package = "staging-xcm", version = "8.0.0" } -pallet-xcm = { version = "8.0.1" } +xcm = { package = "staging-xcm", version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } # Cumulus diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs index eaf2a15e11..fbe8ba8133 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs @@ -27,3 +27,15 @@ emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_ POLKADOT_ED, system_parachains_constants::polkadot::fee::WeightToFee ); + +#[test] +fn assets_can_be_claimed() { + use asset_hub_polkadot_runtime::ExistentialDeposit; + use integration_tests_helpers::test_parachain_can_claim_assets; + use xcm_executor::traits::DropAssets; + + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_parachain_can_claim_assets!(AssetHubPolkadot, RuntimeCall, NetworkId::Polkadot, assets, amount); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml index bf134f8400..40b168d264 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml @@ -17,8 +17,8 @@ pallet-assets = { version = "30.0.0" } pallet-message-queue = { version = "32.0.0" } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.0" } -pallet-xcm = { version = "8.0.1" } +xcm = { package = "staging-xcm", version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } # Cumulus diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs index 4bd2c77fc2..40abcc0f73 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs @@ -106,3 +106,15 @@ pub(crate) fn assert_bridge_hub_polkadot_message_received() { ); }) } + +#[test] +fn assets_can_be_claimed() { + use bridge_hub_kusama_runtime::ExistentialDeposit; + use integration_tests_helpers::test_parachain_can_claim_assets; + use xcm_executor::traits::DropAssets; + + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_parachain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml index 18026e77e3..c7e4151cee 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml @@ -17,8 +17,8 @@ pallet-assets = { version = "30.0.0" } pallet-message-queue = { version = "32.0.0" } # Polkadot -xcm = { package = "staging-xcm", version = "8.0.0" } -pallet-xcm = { version = "8.0.1" } +xcm = { package = "staging-xcm", version = "8.0.1" } +pallet-xcm = { version = "8.0.2" } xcm-executor = { package = "staging-xcm-executor", version = "8.0.1" } # Cumulus diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs index 1884e8cc2d..25dcdcecf6 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs @@ -106,3 +106,15 @@ pub(crate) fn assert_bridge_hub_kusama_message_received() { ); }) } + +#[test] +fn assets_can_be_claimed() { + use bridge_hub_polkadot_runtime::ExistentialDeposit; + use integration_tests_helpers::test_parachain_can_claim_assets; + use xcm_executor::traits::DropAssets; + + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_parachain_can_claim_assets!(AssetHubPolkadot, RuntimeCall, NetworkId::Polkadot, assets, amount); +} From f1660728a673318c788423ce78d3783326d46713 Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Mon, 4 Mar 2024 12:51:53 +0100 Subject: [PATCH 3/8] fix(pallet_xcm::benchmarking): add missing get_asset function to runtimes --- relay/kusama/src/lib.rs | 7 +++++++ relay/polkadot/src/lib.rs | 7 +++++++ system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs | 7 +++++++ system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs | 7 +++++++ system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs | 7 +++++++ .../bridge-hubs/bridge-hub-polkadot/src/lib.rs | 7 +++++++ .../collectives/collectives-polkadot/src/lib.rs | 7 +++++++ 7 files changed, 49 insertions(+) diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index 34b4bc8bc7..631e9f4ac2 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -2599,6 +2599,13 @@ sp_api::impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::here()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index f6f3537e12..178f7e66f7 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -2486,6 +2486,13 @@ sp_api::impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::here()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 7c5ded40cd..192ef60fec 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -1428,6 +1428,13 @@ impl_runtime_apis! { }); Some((assets, fee_index as u32, dest, verify)) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index 539bb55fd2..6feef077ca 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -1298,6 +1298,13 @@ impl_runtime_apis! { }); Some((assets, fee_index as u32, dest, verify)) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index 19d181363a..d030e2c27c 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -865,6 +865,13 @@ impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 6ccbd55d46..a3880b3b16 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -866,6 +866,13 @@ impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } impl pallet_xcm_benchmarks::Config for Runtime { diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index b87991bd42..42d1472af3 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -1021,6 +1021,13 @@ impl_runtime_apis! { dest ) } + + fn get_asset() -> Asset { + Asset { + id: AssetId(Location::parent()), + fun: Fungible(ExistentialDeposit::get()), + } + } } let whitelist: Vec = vec![ From 25cd3aa5b51e2b38ff9d9d76420583c1e838fcb0 Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Mon, 4 Mar 2024 12:52:47 +0100 Subject: [PATCH 4/8] fix: fmt --- .../tests/assets/asset-hub-kusama/src/tests/mod.rs | 8 +++++++- .../tests/assets/asset-hub-polkadot/src/tests/mod.rs | 8 +++++++- .../tests/bridges/bridge-hub-kusama/src/tests/mod.rs | 8 +++++++- .../tests/bridges/bridge-hub-polkadot/src/tests/mod.rs | 8 +++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs index 5c528c5401..efa525db8e 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs @@ -36,5 +36,11 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_parachain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); + test_parachain_can_claim_assets!( + AssetHubKusama, + RuntimeCall, + NetworkId::Kusama, + assets, + amount + ); } diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs index fbe8ba8133..54ebe4678b 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs @@ -37,5 +37,11 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_parachain_can_claim_assets!(AssetHubPolkadot, RuntimeCall, NetworkId::Polkadot, assets, amount); + test_parachain_can_claim_assets!( + AssetHubPolkadot, + RuntimeCall, + NetworkId::Polkadot, + assets, + amount + ); } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs index 40abcc0f73..e2b9e57465 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs @@ -116,5 +116,11 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_parachain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); + test_parachain_can_claim_assets!( + AssetHubKusama, + RuntimeCall, + NetworkId::Kusama, + assets, + amount + ); } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs index 25dcdcecf6..f46331d9b0 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs @@ -116,5 +116,11 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_parachain_can_claim_assets!(AssetHubPolkadot, RuntimeCall, NetworkId::Polkadot, assets, amount); + test_parachain_can_claim_assets!( + AssetHubPolkadot, + RuntimeCall, + NetworkId::Polkadot, + assets, + amount + ); } From e5a9e985f2d823abdbd7062f7a939b21c19861ee Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Mon, 4 Mar 2024 16:05:26 +0100 Subject: [PATCH 5/8] chore: move claim_asset tests to their own file under each runtime --- .../src/tests/claim_assets.rs | 36 +++++++++++++++++++ .../assets/asset-hub-kusama/src/tests/mod.rs | 19 +--------- .../src/tests/claim_assets.rs | 36 +++++++++++++++++++ .../asset-hub-polkadot/src/tests/mod.rs | 19 +--------- .../src/tests/claim_assets.rs | 36 +++++++++++++++++++ .../bridge-hub-kusama/src/tests/mod.rs | 19 +--------- .../src/tests/claim_assets.rs | 36 +++++++++++++++++++ .../bridge-hub-polkadot/src/tests/mod.rs | 19 +--------- 8 files changed, 148 insertions(+), 72 deletions(-) create mode 100644 integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs create mode 100644 integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs create mode 100644 integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs create mode 100644 integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs new file mode 100644 index 0000000000..efef7fb181 --- /dev/null +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs @@ -0,0 +1,36 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests related to claiming assets trapped during XCM execution. + +use crate::*; + +use asset_hub_kusama_runtime::ExistentialDeposit; +use integration_tests_helpers::test_parachain_can_claim_assets; +use xcm_executor::traits::DropAssets; + +#[test] +fn assets_can_be_claimed() { + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_parachain_can_claim_assets!( + AssetHubKusama, + RuntimeCall, + NetworkId::Kusama, + assets, + amount + ); +} diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs index efa525db8e..9086d73afb 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs @@ -18,6 +18,7 @@ mod send; mod set_xcm_versions; mod swap; mod teleport; +mod claim_assets; use crate::*; emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_hub!( @@ -26,21 +27,3 @@ emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_ KUSAMA_ED, system_parachains_constants::kusama::fee::WeightToFee ); - -#[test] -fn assets_can_be_claimed() { - use asset_hub_kusama_runtime::ExistentialDeposit; - use integration_tests_helpers::test_parachain_can_claim_assets; - use xcm_executor::traits::DropAssets; - - let amount = ExistentialDeposit::get(); - let assets: Assets = (Parent, amount).into(); - - test_parachain_can_claim_assets!( - AssetHubKusama, - RuntimeCall, - NetworkId::Kusama, - assets, - amount - ); -} diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs new file mode 100644 index 0000000000..cd3a02d515 --- /dev/null +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs @@ -0,0 +1,36 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests related to claiming assets trapped during XCM execution. + +use crate::*; + +use asset_hub_polkadot_runtime::ExistentialDeposit; +use integration_tests_helpers::test_parachain_can_claim_assets; +use xcm_executor::traits::DropAssets; + +#[test] +fn assets_can_be_claimed() { + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_parachain_can_claim_assets!( + AssetHubPolkadot, + RuntimeCall, + NetworkId::Polkadot, + assets, + amount + ); +} diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs index 54ebe4678b..b6044152db 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs @@ -19,6 +19,7 @@ mod send; mod set_xcm_versions; mod teleport; mod treasury; +mod claim_assets; use crate::*; emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_hub!( @@ -27,21 +28,3 @@ emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_ POLKADOT_ED, system_parachains_constants::polkadot::fee::WeightToFee ); - -#[test] -fn assets_can_be_claimed() { - use asset_hub_polkadot_runtime::ExistentialDeposit; - use integration_tests_helpers::test_parachain_can_claim_assets; - use xcm_executor::traits::DropAssets; - - let amount = ExistentialDeposit::get(); - let assets: Assets = (Parent, amount).into(); - - test_parachain_can_claim_assets!( - AssetHubPolkadot, - RuntimeCall, - NetworkId::Polkadot, - assets, - amount - ); -} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs new file mode 100644 index 0000000000..89b2eda2d1 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs @@ -0,0 +1,36 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests related to claiming assets trapped during XCM execution. + +use crate::*; + +use bridge_hub_kusama_runtime::ExistentialDeposit; +use integration_tests_helpers::test_parachain_can_claim_assets; +use xcm_executor::traits::DropAssets; + +#[test] +fn assets_can_be_claimed() { + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_parachain_can_claim_assets!( + AssetHubKusama, + RuntimeCall, + NetworkId::Kusama, + assets, + amount + ); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs index e2b9e57465..716add5d9f 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs @@ -18,6 +18,7 @@ use crate::*; mod asset_transfers; mod send_xcm; mod teleport; +mod claim_assets; pub(crate) fn asset_hub_polkadot_location() -> Location { Location::new( @@ -106,21 +107,3 @@ pub(crate) fn assert_bridge_hub_polkadot_message_received() { ); }) } - -#[test] -fn assets_can_be_claimed() { - use bridge_hub_kusama_runtime::ExistentialDeposit; - use integration_tests_helpers::test_parachain_can_claim_assets; - use xcm_executor::traits::DropAssets; - - let amount = ExistentialDeposit::get(); - let assets: Assets = (Parent, amount).into(); - - test_parachain_can_claim_assets!( - AssetHubKusama, - RuntimeCall, - NetworkId::Kusama, - assets, - amount - ); -} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs new file mode 100644 index 0000000000..5ba32202da --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs @@ -0,0 +1,36 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tests related to claiming assets trapped during XCM execution. + +use crate::*; + +use bridge_hub_polkadot_runtime::ExistentialDeposit; +use integration_tests_helpers::test_parachain_can_claim_assets; +use xcm_executor::traits::DropAssets; + +#[test] +fn assets_can_be_claimed() { + let amount = ExistentialDeposit::get(); + let assets: Assets = (Parent, amount).into(); + + test_parachain_can_claim_assets!( + AssetHubPolkadot, + RuntimeCall, + NetworkId::Polkadot, + assets, + amount + ); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs index f46331d9b0..a2d73cbf82 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs @@ -18,6 +18,7 @@ use crate::*; mod asset_transfers; mod send_xcm; mod teleport; +mod claim_assets; pub(crate) fn asset_hub_kusama_location() -> Location { Location::new( @@ -106,21 +107,3 @@ pub(crate) fn assert_bridge_hub_kusama_message_received() { ); }) } - -#[test] -fn assets_can_be_claimed() { - use bridge_hub_polkadot_runtime::ExistentialDeposit; - use integration_tests_helpers::test_parachain_can_claim_assets; - use xcm_executor::traits::DropAssets; - - let amount = ExistentialDeposit::get(); - let assets: Assets = (Parent, amount).into(); - - test_parachain_can_claim_assets!( - AssetHubPolkadot, - RuntimeCall, - NetworkId::Polkadot, - assets, - amount - ); -} From 74368e3c677f933de2c1561ed26d2bc7e49ff822 Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Mon, 4 Mar 2024 16:16:27 +0100 Subject: [PATCH 6/8] chore(claim_assets): add weights --- relay/kusama/src/weights/pallet_xcm.rs | 5 ++++- relay/polkadot/src/weights/pallet_xcm.rs | 5 ++++- .../asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs | 5 ++++- .../asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs | 5 ++++- .../bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs | 5 ++++- .../bridge-hub-polkadot/src/weights/pallet_xcm.rs | 5 ++++- .../collectives-polkadot/src/weights/pallet_xcm.rs | 5 ++++- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/relay/kusama/src/weights/pallet_xcm.rs b/relay/kusama/src/weights/pallet_xcm.rs index 8a0ea074ee..724f5c5498 100644 --- a/relay/kusama/src/weights/pallet_xcm.rs +++ b/relay/kusama/src/weights/pallet_xcm.rs @@ -52,7 +52,10 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { fn claim_assets() -> Weight { - todo!() + Weight::from_parts(35_514_000, 0) + .saturating_add(Weight::from_parts(0, 3488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) diff --git a/relay/polkadot/src/weights/pallet_xcm.rs b/relay/polkadot/src/weights/pallet_xcm.rs index dd0e99b5f3..0e606a50e8 100644 --- a/relay/polkadot/src/weights/pallet_xcm.rs +++ b/relay/polkadot/src/weights/pallet_xcm.rs @@ -52,7 +52,10 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { fn claim_assets() -> Weight { - todo!() + Weight::from_parts(35_299_000, 0) + .saturating_add(Weight::from_parts(0, 3488)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs index 90c760d32f..482a11b7b4 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm.rs @@ -48,7 +48,10 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { fn claim_assets() -> Weight { - todo!() + Weight::from_parts(39_122_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs index 65e292b239..8a3e9507bc 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm.rs @@ -48,7 +48,10 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { fn claim_assets() -> Weight { - todo!() + Weight::from_parts(38_075_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs index 7f8f99c6f5..53f8f55452 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs @@ -48,7 +48,10 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { fn claim_assets() -> Weight { - todo!() + Weight::from_parts(34_674_000, 0) + .saturating_add(Weight::from_parts(0, 3555)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs index 748f0b5ba0..7653c823cd 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm.rs @@ -48,7 +48,10 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { fn claim_assets() -> Weight { - todo!() + Weight::from_parts(35_411_000, 0) + .saturating_add(Weight::from_parts(0, 3555)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) diff --git a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs index 9e7772d486..5584d02126 100644 --- a/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs +++ b/system-parachains/collectives/collectives-polkadot/src/weights/pallet_xcm.rs @@ -48,7 +48,10 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_xcm::WeightInfo for WeightInfo { fn claim_assets() -> Weight { - todo!() + Weight::from_parts(36_978_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) From dc65e7e4975160953dd7e4f07d34c21876b4e7fe Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Mon, 4 Mar 2024 18:39:07 +0100 Subject: [PATCH 7/8] feat(claim_assets): more test cases --- integration-tests/emulated/helpers/src/lib.rs | 48 ++++++++++++++++++- .../src/tests/claim_assets.rs | 4 +- .../src/tests/claim_assets.rs | 4 +- .../src/tests/claim_assets.rs | 4 +- .../src/tests/claim_assets.rs | 4 +- 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/integration-tests/emulated/helpers/src/lib.rs b/integration-tests/emulated/helpers/src/lib.rs index 438f320cfa..c761854512 100644 --- a/integration-tests/emulated/helpers/src/lib.rs +++ b/integration-tests/emulated/helpers/src/lib.rs @@ -124,7 +124,7 @@ macro_rules! test_parachain_is_trusted_teleporter { } #[macro_export] -macro_rules! test_parachain_can_claim_assets { +macro_rules! test_chain_can_claim_assets { ( $sender_para:ty, $runtime_call:ty, $network_id:expr, $assets:expr, $amount:expr ) => { $crate::paste::paste! { let sender = [<$sender_para Sender>]::get(); @@ -139,7 +139,7 @@ macro_rules! test_parachain_can_claim_assets { // The possible reasons for this might differ from runtime to runtime, so here we just drop them directly. <$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::drop_assets( &beneficiary, - $assets.into(), + $assets.clone().into(), &XcmContext { origin: None, message_id: [0u8; 32], topic: None }, ); @@ -155,6 +155,21 @@ macro_rules! test_parachain_can_claim_assets { let balance_before = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&sender); + // Different origin or different assets won't work. + let other_origin = <$sender_para as $crate::Chain>::RuntimeOrigin::signed([<$sender_para Receiver>]::get()); + assert!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + other_origin, + bx!(versioned_assets.clone().into()), + bx!(beneficiary.clone().into()), + ).is_err()); + let other_versioned_assets: $crate::VersionedAssets = Assets::new().into(); + assert!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + origin.clone(), + bx!(other_versioned_assets.into()), + bx!(beneficiary.clone().into()), + ).is_err()); + + // Assets will be claimed to `beneficiary`, which is the same as `sender`. assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( origin.clone(), bx!(versioned_assets.clone().into()), @@ -170,8 +185,37 @@ macro_rules! test_parachain_can_claim_assets { ] ); + // After claiming the assets, the balance has increased. let balance_after = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&sender); assert_eq!(balance_after, balance_before + $amount); + + // Claiming the assets again doesn't work. + assert!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + origin.clone(), + bx!(versioned_assets.clone().into()), + bx!(beneficiary.clone().into()), + ).is_err()); + + let balance = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&sender); + assert_eq!(balance, balance_after); + + // You can also claim assets and send them to a different account. + <$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::drop_assets( + &beneficiary, + $assets.clone().into(), + &XcmContext { origin: None, message_id: [0u8; 32], topic: None }, + ); + let receiver = [<$sender_para Receiver>]::get(); + let other_beneficiary: Location = + $crate::AccountId32 { network: Some($network_id), id: receiver.clone().into() }.into(); + let balance_before = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&receiver); + assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PolkadotXcm::claim_assets( + origin.clone(), + bx!(versioned_assets.clone().into()), + bx!(other_beneficiary.clone().into()), + )); + let balance_after = <$sender_para as [<$sender_para Pallet>]>::Balances::free_balance(&receiver); + assert_eq!(balance_after, balance_before + $amount); }); } }; diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs index efef7fb181..728fd27409 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs @@ -18,7 +18,7 @@ use crate::*; use asset_hub_kusama_runtime::ExistentialDeposit; -use integration_tests_helpers::test_parachain_can_claim_assets; +use integration_tests_helpers::test_chain_can_claim_assets; use xcm_executor::traits::DropAssets; #[test] @@ -26,7 +26,7 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_parachain_can_claim_assets!( + test_chain_can_claim_assets!( AssetHubKusama, RuntimeCall, NetworkId::Kusama, diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs index cd3a02d515..676b210170 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs @@ -18,7 +18,7 @@ use crate::*; use asset_hub_polkadot_runtime::ExistentialDeposit; -use integration_tests_helpers::test_parachain_can_claim_assets; +use integration_tests_helpers::test_chain_can_claim_assets; use xcm_executor::traits::DropAssets; #[test] @@ -26,7 +26,7 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_parachain_can_claim_assets!( + test_chain_can_claim_assets!( AssetHubPolkadot, RuntimeCall, NetworkId::Polkadot, diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs index 89b2eda2d1..79e90090e3 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs @@ -18,7 +18,7 @@ use crate::*; use bridge_hub_kusama_runtime::ExistentialDeposit; -use integration_tests_helpers::test_parachain_can_claim_assets; +use integration_tests_helpers::test_chain_can_claim_assets; use xcm_executor::traits::DropAssets; #[test] @@ -26,7 +26,7 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_parachain_can_claim_assets!( + test_chain_can_claim_assets!( AssetHubKusama, RuntimeCall, NetworkId::Kusama, diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs index 5ba32202da..450788b92b 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs @@ -18,7 +18,7 @@ use crate::*; use bridge_hub_polkadot_runtime::ExistentialDeposit; -use integration_tests_helpers::test_parachain_can_claim_assets; +use integration_tests_helpers::test_chain_can_claim_assets; use xcm_executor::traits::DropAssets; #[test] @@ -26,7 +26,7 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_parachain_can_claim_assets!( + test_chain_can_claim_assets!( AssetHubPolkadot, RuntimeCall, NetworkId::Polkadot, From daef9290731f24e747e4a52ef9684c244d2a8392 Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Mon, 4 Mar 2024 18:39:48 +0100 Subject: [PATCH 8/8] fix: fmt --- .../assets/asset-hub-kusama/src/tests/claim_assets.rs | 8 +------- .../tests/assets/asset-hub-kusama/src/tests/mod.rs | 2 +- .../tests/assets/asset-hub-polkadot/src/tests/mod.rs | 2 +- .../bridges/bridge-hub-kusama/src/tests/claim_assets.rs | 8 +------- .../tests/bridges/bridge-hub-kusama/src/tests/mod.rs | 2 +- .../tests/bridges/bridge-hub-polkadot/src/tests/mod.rs | 2 +- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs index 728fd27409..a08bc885c0 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs @@ -26,11 +26,5 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_chain_can_claim_assets!( - AssetHubKusama, - RuntimeCall, - NetworkId::Kusama, - assets, - amount - ); + test_chain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); } diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs index 9086d73afb..3bded12dd1 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/mod.rs @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +mod claim_assets; mod reserve_transfer; mod send; mod set_xcm_versions; mod swap; mod teleport; -mod claim_assets; use crate::*; emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_hub!( diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs index b6044152db..4029a58cae 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/mod.rs @@ -13,13 +13,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +mod claim_assets; mod fellowship_treasury; mod reserve_transfer; mod send; mod set_xcm_versions; mod teleport; mod treasury; -mod claim_assets; use crate::*; emulated_integration_tests_common::include_penpal_create_foreign_asset_on_asset_hub!( diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs index 79e90090e3..976d90ebe5 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs @@ -26,11 +26,5 @@ fn assets_can_be_claimed() { let amount = ExistentialDeposit::get(); let assets: Assets = (Parent, amount).into(); - test_chain_can_claim_assets!( - AssetHubKusama, - RuntimeCall, - NetworkId::Kusama, - assets, - amount - ); + test_chain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs index 716add5d9f..91a6b7b08f 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/mod.rs @@ -16,9 +16,9 @@ use crate::*; mod asset_transfers; +mod claim_assets; mod send_xcm; mod teleport; -mod claim_assets; pub(crate) fn asset_hub_polkadot_location() -> Location { Location::new( diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs index a2d73cbf82..b0560761ee 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/mod.rs @@ -16,9 +16,9 @@ use crate::*; mod asset_transfers; +mod claim_assets; mod send_xcm; mod teleport; -mod claim_assets; pub(crate) fn asset_hub_kusama_location() -> Location { Location::new(