XCM: Replace council XCM origin with general admin (#7633)

* XCM: Replace council XCM origin with general admin

* Fixes

* Fixes

* Update runtime/polkadot/src/xcm_config.rs

Co-authored-by: ordian <write@reusable.software>

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: ordian <write@reusable.software>
Co-authored-by: command-bot <>
This commit is contained in:
Keith Yeung
2023-08-17 22:15:35 -07:00
committed by GitHub
parent eaf057c5ed
commit 688a4e4126
4 changed files with 25 additions and 46 deletions
+5 -23
View File
@@ -17,8 +17,8 @@
//! XCM configuration for Rococo.
use super::{
parachains_origin, AccountId, AllPalletsWithSystem, Balances, CouncilCollective, Dmp, ParaId,
Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, TransactionByteFee, WeightToFee, XcmPallet,
parachains_origin, AccountId, AllPalletsWithSystem, Balances, Dmp, ParaId, Runtime,
RuntimeCall, RuntimeEvent, RuntimeOrigin, TransactionByteFee, WeightToFee, XcmPallet,
};
use frame_support::{
match_types, parameter_types,
@@ -36,8 +36,8 @@ use sp_core::ConstU32;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, BackingToPlurality,
ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete,
MintLocation, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation,
TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin,
@@ -322,33 +322,15 @@ impl xcm_executor::Config for XcmConfig {
type Aliasers = Nothing;
}
parameter_types! {
pub const CollectiveBodyId: BodyId = BodyId::Unit;
}
parameter_types! {
pub const CouncilBodyId: BodyId = BodyId::Executive;
}
#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parachain(1000).into());
}
/// Type to convert the council origin to a Plurality `MultiLocation` value.
pub type CouncilToPlurality = BackingToPlurality<
RuntimeOrigin,
pallet_collective::Origin<Runtime, CouncilCollective>,
CouncilBodyId,
>;
/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior
/// location of this chain.
pub type LocalOriginToLocation = (
// We allow an origin from the Collective pallet to be used in XCM as a corresponding Plurality
// of the `Unit` body.
CouncilToPlurality,
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
// A usual Signed origin to be used in XCM as a corresponding AccountId32
SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>,
);
impl pallet_xcm::Config for Runtime {