From d1470aba7390dde2d6e9c310963636e615b0cba6 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 14 Aug 2023 23:30:22 +0200 Subject: [PATCH] `PriceForSiblingDelivery` replaced by `runtime::common::PriceForParachainDelivery` --- pallets/xcmp-queue/src/lib.rs | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/pallets/xcmp-queue/src/lib.rs b/pallets/xcmp-queue/src/lib.rs index d48de35cef0..960af9b5b77 100644 --- a/pallets/xcmp-queue/src/lib.rs +++ b/pallets/xcmp-queue/src/lib.rs @@ -47,7 +47,7 @@ use frame_support::{ traits::{EnsureOrigin, Get}, weights::{constants::WEIGHT_REF_TIME_PER_MILLIS, Weight}, }; -use polkadot_runtime_common::xcm_sender::ConstantPrice; +use polkadot_runtime_common::xcm_sender::PriceForParachainDelivery; use rand_chacha::{ rand_core::{RngCore, SeedableRng}, ChaChaRng, @@ -107,7 +107,7 @@ pub mod pallet { type ControllerOriginConverter: ConvertOrigin; /// The price for delivering an XCM to a sibling parachain destination. - type PriceForSiblingDelivery: PriceForSiblingDelivery; + type PriceForSiblingDelivery: PriceForParachainDelivery; /// The weight information of this pallet. type WeightInfo: WeightInfo; @@ -1137,22 +1137,6 @@ impl XcmpMessageSource for Pallet { } } -pub trait PriceForSiblingDelivery { - fn price_for_sibling_delivery(id: ParaId, message: &Xcm<()>) -> MultiAssets; -} - -impl PriceForSiblingDelivery for () { - fn price_for_sibling_delivery(_: ParaId, _: &Xcm<()>) -> MultiAssets { - MultiAssets::new() - } -} - -impl> PriceForSiblingDelivery for ConstantPrice { - fn price_for_sibling_delivery(_: ParaId, _: &Xcm<()>) -> MultiAssets { - T::get() - } -} - /// Xcm sender for sending to a sibling parachain. impl SendXcm for Pallet { type Ticket = (ParaId, VersionedXcm<()>); @@ -1168,7 +1152,7 @@ impl SendXcm for Pallet { MultiLocation { parents: 1, interior: X1(Parachain(id)) } => { let xcm = msg.take().ok_or(SendError::MissingArgument)?; let id = ParaId::from(*id); - let price = T::PriceForSiblingDelivery::price_for_sibling_delivery(id, &xcm); + let price = T::PriceForSiblingDelivery::price_for_parachain_delivery(id, &xcm); let versioned_xcm = T::VersionWrapper::wrap_version(&d, xcm) .map_err(|()| SendError::DestinationUnsupported)?; Ok(((id, versioned_xcm), price))