Skip to content

Commit

Permalink
Fix pallet-xcm
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr committed Nov 30, 2024
1 parent 040da5d commit 080ff18
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions polkadot/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2467,14 +2467,14 @@ sp_api::impl_runtime_apis! {
ExistentialDepositAsset,
xcm_config::PriceForChildParachainDelivery,
AssetHubParaId,
(),
Dmp,
>,
polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper<
XcmConfig,
ExistentialDepositAsset,
xcm_config::PriceForChildParachainDelivery,
RandomParaId,
(),
Dmp,
>
);

Expand Down
18 changes: 13 additions & 5 deletions polkadot/xcm/pallet-xcm/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ benchmarks! {
let versioned_msg = VersionedXcm::from(msg);

// Ensure that origin can send to destination (e.g. setup delivery fees, ensure router setup, ...)
let (_, _) = T::DeliveryHelper::ensure_successful_delivery(
T::DeliveryHelper::ensure_successful_delivery(
&Default::default(),
&versioned_dest.clone().try_into().unwrap(),
FeeReason::ChargeFees,
Expand Down Expand Up @@ -171,7 +171,7 @@ benchmarks! {
}

// Ensure that origin can send to destination (e.g. setup delivery fees, ensure router setup, ...)
let (_, _) = T::DeliveryHelper::ensure_successful_delivery(
T::DeliveryHelper::ensure_successful_delivery(
&origin_location,
&destination,
FeeReason::ChargeFees,
Expand Down Expand Up @@ -234,6 +234,13 @@ benchmarks! {
let versioned_beneficiary: VersionedLocation =
AccountId32 { network: None, id: recipient.into() }.into();
let versioned_assets: VersionedAssets = assets.into();

// Ensure that origin can send to destination (e.g. setup delivery fees, ensure router setup, ...)
T::DeliveryHelper::ensure_successful_delivery(
&Default::default(),
&versioned_dest.clone().try_into().unwrap(),
FeeReason::ChargeFees,
);
}: _<RuntimeOrigin<T>>(send_origin.into(), Box::new(versioned_dest), Box::new(versioned_beneficiary), Box::new(versioned_assets), 0, WeightLimit::Unlimited)
verify {
// run provided verification function
Expand Down Expand Up @@ -268,7 +275,7 @@ benchmarks! {
.into();

// Ensure that origin can send to destination (e.g. setup delivery fees, ensure router setup, ...)
let (_, _) = T::DeliveryHelper::ensure_successful_delivery(
T::DeliveryHelper::ensure_successful_delivery(
&Default::default(),
&versioned_loc.clone().try_into().unwrap(),
FeeReason::ChargeFees,
Expand All @@ -281,14 +288,15 @@ benchmarks! {
BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)),
)?;
let versioned_loc: VersionedLocation = loc.clone().into();
let _ = crate::Pallet::<T>::request_version_notify(loc);

// Ensure that origin can send to destination (e.g. setup delivery fees, ensure router setup, ...)
let (_, _) = T::DeliveryHelper::ensure_successful_delivery(
T::DeliveryHelper::ensure_successful_delivery(
&Default::default(),
&versioned_loc.clone().try_into().unwrap(),
FeeReason::ChargeFees,
);

let _ = crate::Pallet::<T>::request_version_notify(loc);
}: _(RawOrigin::Root, Box::new(versioned_loc))

force_suspension {}: _(RawOrigin::Root, true)
Expand Down

0 comments on commit 080ff18

Please sign in to comment.