mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 12:51:02 +00:00
Rococo allows ROC to be teleported from Tick, Trick and Track (#2872)
Also allows unpaid messages from them.
This commit is contained in:
@@ -602,6 +602,39 @@ pub type XcmRouter = (
|
|||||||
xcm_sender::ChildParachainRouter<Runtime>,
|
xcm_sender::ChildParachainRouter<Runtime>,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
use xcm::v0::{MultiAsset, MultiAsset::AllConcreteFungible, MultiLocation::{Null, X1}, Junction::Parachain};
|
||||||
|
parameter_types! {
|
||||||
|
pub const RococoForTick: (MultiAsset, MultiLocation) = (AllConcreteFungible { id: Null }, X1(Parachain{id: 100}));
|
||||||
|
pub const RococoForTrick: (MultiAsset, MultiLocation) = (AllConcreteFungible { id: Null }, X1(Parachain{id: 110}));
|
||||||
|
pub const RococoForTrack: (MultiAsset, MultiLocation) = (AllConcreteFungible { id: Null }, X1(Parachain{id: 120}));
|
||||||
|
}
|
||||||
|
pub type TrustedTeleporters = (
|
||||||
|
xcm_builder::Case<RococoForTick>,
|
||||||
|
xcm_builder::Case<RococoForTrick>,
|
||||||
|
xcm_builder::Case<RococoForTrack>,
|
||||||
|
);
|
||||||
|
|
||||||
|
parameter_types! {
|
||||||
|
pub AllowUnpaidFrom: Vec<MultiLocation> = vec![ X1(Parachain{id: 100}), X1(Parachain{id: 110}), X1(Parachain{id: 120}) ];
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct All<T>(sp_std::marker::PhantomData<T>);
|
||||||
|
impl<T: Ord> frame_support::traits::Contains<T> for All<T> {
|
||||||
|
fn contains(_: &T) -> bool { true }
|
||||||
|
fn sorted_members() -> Vec<T> { vec![] }
|
||||||
|
}
|
||||||
|
pub struct IsInVec<T>(sp_std::marker::PhantomData<T>);
|
||||||
|
impl<X: Ord + PartialOrd, T: frame_support::traits::Get<Vec<X>>> frame_support::traits::Contains<X> for IsInVec<T> {
|
||||||
|
fn sorted_members() -> Vec<X> { let mut r = T::get(); r.sort(); r }
|
||||||
|
}
|
||||||
|
|
||||||
|
use xcm_builder::{TakeWeightCredit, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom};
|
||||||
|
pub type Barrier = (
|
||||||
|
TakeWeightCredit,
|
||||||
|
AllowTopLevelPaidExecutionFrom<All<MultiLocation>>,
|
||||||
|
AllowUnpaidExecutionFrom<IsInVec<AllowUnpaidFrom>>, // <- Trusted parachains get free execution
|
||||||
|
);
|
||||||
|
|
||||||
pub struct XcmConfig;
|
pub struct XcmConfig;
|
||||||
impl xcm_executor::Config for XcmConfig {
|
impl xcm_executor::Config for XcmConfig {
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
@@ -609,9 +642,9 @@ impl xcm_executor::Config for XcmConfig {
|
|||||||
type AssetTransactor = LocalAssetTransactor;
|
type AssetTransactor = LocalAssetTransactor;
|
||||||
type OriginConverter = LocalOriginConverter;
|
type OriginConverter = LocalOriginConverter;
|
||||||
type IsReserve = ();
|
type IsReserve = ();
|
||||||
type IsTeleporter = ();
|
type IsTeleporter = TrustedTeleporters;
|
||||||
type LocationInverter = LocationInverter<Ancestry>;
|
type LocationInverter = LocationInverter<Ancestry>;
|
||||||
type Barrier = ();
|
type Barrier = Barrier;
|
||||||
type Weigher = FixedWeightBounds<BaseXcmWeight, Call>;
|
type Weigher = FixedWeightBounds<BaseXcmWeight, Call>;
|
||||||
type Trader = FixedRateOfConcreteFungible<RocFee>;
|
type Trader = FixedRateOfConcreteFungible<RocFee>;
|
||||||
type ResponseHandler = ();
|
type ResponseHandler = ();
|
||||||
|
|||||||
@@ -26,11 +26,10 @@ impl FilterAssetLocation for NativeAsset {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub struct Case<T>(PhantomData<T>);
|
pub struct Case<T>(PhantomData<T>);
|
||||||
impl<T: Get<(MultiAsset, MultiLocation)>> FilterAssetLocation for Case<T> {
|
impl<T: Get<(MultiAsset, MultiLocation)>> FilterAssetLocation for Case<T> {
|
||||||
fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool {
|
fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool {
|
||||||
let (a, o) = T::get();
|
let (a, o) = T::get();
|
||||||
&a == asset && &o == origin
|
a.contains(asset) && &o == origin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user