mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +00:00
PriceForSiblingDelivery replaced by runtime::common::PriceForParachainDelivery (#3012)
This commit is contained in:
@@ -47,7 +47,7 @@ use frame_support::{
|
|||||||
traits::{EnsureOrigin, Get},
|
traits::{EnsureOrigin, Get},
|
||||||
weights::{constants::WEIGHT_REF_TIME_PER_MILLIS, Weight},
|
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::{
|
use rand_chacha::{
|
||||||
rand_core::{RngCore, SeedableRng},
|
rand_core::{RngCore, SeedableRng},
|
||||||
ChaChaRng,
|
ChaChaRng,
|
||||||
@@ -107,7 +107,7 @@ pub mod pallet {
|
|||||||
type ControllerOriginConverter: ConvertOrigin<Self::RuntimeOrigin>;
|
type ControllerOriginConverter: ConvertOrigin<Self::RuntimeOrigin>;
|
||||||
|
|
||||||
/// The price for delivering an XCM to a sibling parachain destination.
|
/// The price for delivering an XCM to a sibling parachain destination.
|
||||||
type PriceForSiblingDelivery: PriceForSiblingDelivery;
|
type PriceForSiblingDelivery: PriceForParachainDelivery;
|
||||||
|
|
||||||
/// The weight information of this pallet.
|
/// The weight information of this pallet.
|
||||||
type WeightInfo: WeightInfo;
|
type WeightInfo: WeightInfo;
|
||||||
@@ -1137,22 +1137,6 @@ impl<T: Config> XcmpMessageSource for Pallet<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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<T: Get<MultiAssets>> PriceForSiblingDelivery for ConstantPrice<T> {
|
|
||||||
fn price_for_sibling_delivery(_: ParaId, _: &Xcm<()>) -> MultiAssets {
|
|
||||||
T::get()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Xcm sender for sending to a sibling parachain.
|
/// Xcm sender for sending to a sibling parachain.
|
||||||
impl<T: Config> SendXcm for Pallet<T> {
|
impl<T: Config> SendXcm for Pallet<T> {
|
||||||
type Ticket = (ParaId, VersionedXcm<()>);
|
type Ticket = (ParaId, VersionedXcm<()>);
|
||||||
@@ -1168,7 +1152,7 @@ impl<T: Config> SendXcm for Pallet<T> {
|
|||||||
MultiLocation { parents: 1, interior: X1(Parachain(id)) } => {
|
MultiLocation { parents: 1, interior: X1(Parachain(id)) } => {
|
||||||
let xcm = msg.take().ok_or(SendError::MissingArgument)?;
|
let xcm = msg.take().ok_or(SendError::MissingArgument)?;
|
||||||
let id = ParaId::from(*id);
|
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)
|
let versioned_xcm = T::VersionWrapper::wrap_version(&d, xcm)
|
||||||
.map_err(|()| SendError::DestinationUnsupported)?;
|
.map_err(|()| SendError::DestinationUnsupported)?;
|
||||||
Ok(((id, versioned_xcm), price))
|
Ok(((id, versioned_xcm), price))
|
||||||
|
|||||||
Reference in New Issue
Block a user