diff --git a/runtime/moonbase/src/governance/referenda.rs b/runtime/moonbase/src/governance/referenda.rs index 21cd96253f..46033a6a53 100644 --- a/runtime/moonbase/src/governance/referenda.rs +++ b/runtime/moonbase/src/governance/referenda.rs @@ -51,8 +51,9 @@ parameter_types! { pub type GeneralAdminOrRoot = EitherOf, origins::GeneralAdmin>; -/// The policy allows for Root or FastGeneralAdmin. -pub type FastGeneralAdminOrRoot = EitherOf, origins::FastGeneralAdmin>; +/// The policy allows for Root, GeneralAdmin or FastGeneralAdmin. +pub type FastGeneralAdminOrRoot = + EitherOf, EitherOf>; impl custom_origins::Config for Runtime {} diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index a395ef52c1..f5f88a9c0a 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -67,9 +67,9 @@ use frame_support::{ traits::{ fungible::{Balanced, Credit, HoldConsideration, Inspect}, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, - EqualPrivilegeOnly, FindAuthor, InstanceFilter, LinearStoragePrice, OnFinalize, - OnUnbalanced, + ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOf, + EitherOfDiverse, EqualPrivilegeOnly, FindAuthor, InstanceFilter, LinearStoragePrice, + OnFinalize, OnUnbalanced, }, weights::{ constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, @@ -1124,7 +1124,10 @@ pub type ForeignAssetMigratorOrigin = EitherOfDiverse< EnsureRoot, EitherOfDiverse< pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::FastGeneralAdmin, + EitherOf< + governance::custom_origins::GeneralAdmin, + governance::custom_origins::FastGeneralAdmin, + >, >, >; diff --git a/runtime/moonbase/src/xcm_config.rs b/runtime/moonbase/src/xcm_config.rs index a2f25db09c..18a1b8a29a 100644 --- a/runtime/moonbase/src/xcm_config.rs +++ b/runtime/moonbase/src/xcm_config.rs @@ -33,7 +33,7 @@ use sp_runtime::{ use frame_support::{ parameter_types, - traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, + traits::{EitherOf, EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, }; use frame_system::{EnsureRoot, RawOrigin}; @@ -699,7 +699,10 @@ pub type ForeignAssetManagerOrigin = EitherOfDiverse< EnsureRoot, EitherOfDiverse< pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::FastGeneralAdmin, + EitherOf< + governance::custom_origins::GeneralAdmin, + governance::custom_origins::FastGeneralAdmin, + >, >, >; @@ -726,18 +729,34 @@ impl frame_support::traits::Contains for AssetFeesFilter { } } +pub type AddAndEditSupportedAssetOrigin = EitherOfDiverse< + EnsureRoot, + EitherOfDiverse< + pallet_collective::EnsureProportionMoreThan, + EitherOf< + governance::custom_origins::GeneralAdmin, + governance::custom_origins::FastGeneralAdmin, + >, + >, +>; + +pub type RemoveSupportedAssetOrigin = EitherOfDiverse< + EnsureRoot, + pallet_collective::EnsureProportionMoreThan, +>; + impl pallet_xcm_weight_trader::Config for Runtime { type AccountIdToLocation = AccountIdToLocation; - type AddSupportedAssetOrigin = EnsureRoot; + type AddSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; type AssetLocationFilter = AssetFeesFilter; type AssetTransactor = AssetTransactors; type Balance = Balance; - type EditSupportedAssetOrigin = EnsureRoot; + type EditSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; type NativeLocation = SelfReserve; - type PauseSupportedAssetOrigin = EnsureRoot; - type RemoveSupportedAssetOrigin = EnsureRoot; + type PauseSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; + type ResumeSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; + type RemoveSupportedAssetOrigin = RemoveSupportedAssetOrigin; type RuntimeEvent = RuntimeEvent; - type ResumeSupportedAssetOrigin = EnsureRoot; type WeightInfo = moonbase_weights::pallet_xcm_weight_trader::WeightInfo; type WeightToFee = ::WeightToFee; type XcmFeesAccount = XcmFeesAccount; diff --git a/runtime/moonbeam/src/governance/referenda.rs b/runtime/moonbeam/src/governance/referenda.rs index 62720a0d60..f68e69cb23 100644 --- a/runtime/moonbeam/src/governance/referenda.rs +++ b/runtime/moonbeam/src/governance/referenda.rs @@ -50,8 +50,9 @@ parameter_types! { // Origin for general admin or root pub type GeneralAdminOrRoot = EitherOf, origins::GeneralAdmin>; -// The policy allows for Root or FastGeneralAdmin. -pub type FastGeneralAdminOrRoot = EitherOf, origins::FastGeneralAdmin>; +/// The policy allows for Root, GeneralAdmin or FastGeneralAdmin. +pub type FastGeneralAdminOrRoot = + EitherOf, EitherOf>; impl custom_origins::Config for Runtime {} diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index f95e3a8283..bc61f7fb01 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -47,8 +47,9 @@ use frame_support::{ traits::{ fungible::{Balanced, Credit, HoldConsideration, Inspect}, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, - EqualPrivilegeOnly, InstanceFilter, LinearStoragePrice, OnFinalize, OnUnbalanced, + ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOf, + EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter, LinearStoragePrice, OnFinalize, + OnUnbalanced, }, weights::{ constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, @@ -1120,7 +1121,10 @@ pub type ForeignAssetMigratorOrigin = EitherOfDiverse< EnsureRoot, EitherOfDiverse< pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::FastGeneralAdmin, + EitherOf< + governance::custom_origins::GeneralAdmin, + governance::custom_origins::FastGeneralAdmin, + >, >, >; diff --git a/runtime/moonbeam/src/xcm_config.rs b/runtime/moonbeam/src/xcm_config.rs index 506f91d5ff..b0bc7c0d98 100644 --- a/runtime/moonbeam/src/xcm_config.rs +++ b/runtime/moonbeam/src/xcm_config.rs @@ -27,7 +27,7 @@ use super::{ use super::moonbeam_weights; use frame_support::{ parameter_types, - traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, + traits::{EitherOf, EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, }; use moonkit_xcm_primitives::AccountIdAssetIdConversion; use sp_runtime::{ @@ -685,7 +685,10 @@ pub type ForeignAssetManagerOrigin = EitherOfDiverse< EnsureRoot, EitherOfDiverse< pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::FastGeneralAdmin, + EitherOf< + governance::custom_origins::GeneralAdmin, + governance::custom_origins::FastGeneralAdmin, + >, >, >; @@ -712,19 +715,14 @@ impl frame_support::traits::Contains for AssetFeesFilter { } } -pub type AddSupportedAssetOrigin = EitherOfDiverse< - EnsureRoot, - EitherOfDiverse< - pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::GeneralAdmin, - >, ->; - -pub type EditSupportedAssetOrigin = EitherOfDiverse< +pub type AddAndEditSupportedAssetOrigin = EitherOfDiverse< EnsureRoot, EitherOfDiverse< pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::FastGeneralAdmin, + EitherOf< + governance::custom_origins::GeneralAdmin, + governance::custom_origins::FastGeneralAdmin, + >, >, >; @@ -735,16 +733,16 @@ pub type RemoveSupportedAssetOrigin = EitherOfDiverse< impl pallet_xcm_weight_trader::Config for Runtime { type AccountIdToLocation = AccountIdToLocation; - type AddSupportedAssetOrigin = AddSupportedAssetOrigin; + type AddSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; type AssetLocationFilter = AssetFeesFilter; type AssetTransactor = AssetTransactors; type Balance = Balance; - type EditSupportedAssetOrigin = EditSupportedAssetOrigin; + type EditSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; type NativeLocation = SelfReserve; - type PauseSupportedAssetOrigin = EditSupportedAssetOrigin; + type PauseSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; + type ResumeSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; type RemoveSupportedAssetOrigin = RemoveSupportedAssetOrigin; type RuntimeEvent = RuntimeEvent; - type ResumeSupportedAssetOrigin = RemoveSupportedAssetOrigin; type WeightInfo = moonbeam_weights::pallet_xcm_weight_trader::WeightInfo; type WeightToFee = ::WeightToFee; type XcmFeesAccount = XcmFeesAccount; diff --git a/runtime/moonriver/src/governance/referenda.rs b/runtime/moonriver/src/governance/referenda.rs index d3c06af793..58ec4bea3b 100644 --- a/runtime/moonriver/src/governance/referenda.rs +++ b/runtime/moonriver/src/governance/referenda.rs @@ -50,8 +50,9 @@ parameter_types! { // Origin for general admin or root pub type GeneralAdminOrRoot = EitherOf, origins::GeneralAdmin>; -// The policy allows for Root or FastGeneralAdmin. -pub type FastGeneralAdminOrRoot = EitherOf, origins::FastGeneralAdmin>; +/// The policy allows for Root, GeneralAdmin or FastGeneralAdmin. +pub type FastGeneralAdminOrRoot = + EitherOf, EitherOf>; impl custom_origins::Config for Runtime {} diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 730d192224..9a1f95bca2 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -48,8 +48,9 @@ use frame_support::{ traits::{ fungible::{Balanced, Credit, HoldConsideration, Inspect}, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, - EqualPrivilegeOnly, InstanceFilter, LinearStoragePrice, OnFinalize, OnUnbalanced, + ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOf, + EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter, LinearStoragePrice, OnFinalize, + OnUnbalanced, }, weights::{ constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, @@ -1128,7 +1129,10 @@ pub type ForeignAssetMigratorOrigin = EitherOfDiverse< EnsureRoot, EitherOfDiverse< pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::FastGeneralAdmin, + EitherOf< + governance::custom_origins::GeneralAdmin, + governance::custom_origins::FastGeneralAdmin, + >, >, >; diff --git a/runtime/moonriver/src/xcm_config.rs b/runtime/moonriver/src/xcm_config.rs index 1519d25203..dee3e35a1b 100644 --- a/runtime/moonriver/src/xcm_config.rs +++ b/runtime/moonriver/src/xcm_config.rs @@ -27,7 +27,7 @@ use super::{ use super::moonriver_weights; use frame_support::{ parameter_types, - traits::{EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, + traits::{EitherOf, EitherOfDiverse, Everything, Nothing, PalletInfoAccess, TransformOrigin}, }; use moonkit_xcm_primitives::AccountIdAssetIdConversion; use sp_runtime::{ @@ -698,7 +698,10 @@ pub type ForeignAssetManagerOrigin = EitherOfDiverse< EnsureRoot, EitherOfDiverse< pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::FastGeneralAdmin, + EitherOf< + governance::custom_origins::GeneralAdmin, + governance::custom_origins::FastGeneralAdmin, + >, >, >; @@ -725,19 +728,14 @@ impl frame_support::traits::Contains for AssetFeesFilter { } } -pub type AddSupportedAssetOrigin = EitherOfDiverse< +pub type AddAndEditSupportedAssetOrigin = EitherOfDiverse< EnsureRoot, EitherOfDiverse< pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::GeneralAdmin, - >, ->; - -pub type EditSupportedAssetOrigin = EitherOfDiverse< - EnsureRoot, - EitherOfDiverse< - pallet_collective::EnsureProportionMoreThan, - governance::custom_origins::FastGeneralAdmin, + EitherOf< + governance::custom_origins::GeneralAdmin, + governance::custom_origins::FastGeneralAdmin, + >, >, >; @@ -748,17 +746,16 @@ pub type RemoveSupportedAssetOrigin = EitherOfDiverse< impl pallet_xcm_weight_trader::Config for Runtime { type AccountIdToLocation = AccountIdToLocation; - type AddSupportedAssetOrigin = AddSupportedAssetOrigin; + type AddSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; type AssetLocationFilter = AssetFeesFilter; type AssetTransactor = AssetTransactors; type Balance = Balance; - type EditSupportedAssetOrigin = EditSupportedAssetOrigin; + type EditSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; type NativeLocation = SelfReserve; - type PauseSupportedAssetOrigin = EditSupportedAssetOrigin; + type PauseSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; + type ResumeSupportedAssetOrigin = AddAndEditSupportedAssetOrigin; type RemoveSupportedAssetOrigin = RemoveSupportedAssetOrigin; type RuntimeEvent = RuntimeEvent; - type ResumeSupportedAssetOrigin = RemoveSupportedAssetOrigin; - type WeightInfo = moonriver_weights::pallet_xcm_weight_trader::WeightInfo; type WeightToFee = ::WeightToFee; type XcmFeesAccount = XcmFeesAccount;