Vstam1/xcm admin origin (#6928)

* Ensure for a configurable origin in XCM (#6442), cherry picked from
5ae05e1a957857c449a43d8759a21292d03fd049

Add new associated type, AdminOrigin, bounded by EnsureOrigin trait in
XCM pallet. Replace ensure_root() with ensure_origin() from a
EnsureOrigin trait. Set AdminOrigin as EnsureRoot<AccountId> in xcm
configs.

* cargo fmt

* small stylistic change

---------

Co-authored-by: serkul <serkul@pop-os.localdomain>
This commit is contained in:
Just van Stam
2023-03-23 10:58:12 +01:00
committed by GitHub
parent c7b3352b79
commit f989b2bb1a
12 changed files with 33 additions and 4 deletions
@@ -19,6 +19,7 @@ use frame_support::{
traits::{Everything, Nothing},
weights::Weight,
};
use frame_system::EnsureRoot;
use xcm::latest::prelude::*;
use xcm_builder::{
AllowUnpaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, SignedAccountId32AsNative,
@@ -146,4 +147,5 @@ impl pallet_xcm::Config for crate::Runtime {
type WeightInfo = pallet_xcm::TestWeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
type AdminOrigin = EnsureRoot<crate::AccountId>;
}