--- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -68,7 +68,7 @@ type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Origin for force registering of a foreign asset. - type ForceRegisterOrigin: EnsureOrigin; + type ManagerOrigin: EnsureOrigin; /// The ID of the foreign assets pallet. type PalletId: Get; @@ -154,7 +154,7 @@ token_prefix: CollectionTokenPrefix, mode: ForeignCollectionMode, ) -> DispatchResult { - T::ForceRegisterOrigin::ensure_origin(origin.clone())?; + T::ManagerOrigin::ensure_origin(origin.clone())?; let asset_id: AssetId = versioned_asset_id .as_ref() --- /dev/null +++ b/runtime/common/config/governance/financial_council.rs @@ -0,0 +1,56 @@ +use super::*; + +parameter_types! { + pub FinancialCouncilMaxProposals: u32 = 100; + pub FinancialCouncilMaxMembers: u32 = 100; +} + +#[cfg(not(feature = "gov-test-timings"))] +use crate::governance_timings::financial_council as financial_council_timings; + +#[cfg(feature = "gov-test-timings")] +pub mod financial_council_timings { + use super::*; + + parameter_types! { + pub FinancialCouncilMotionDuration: BlockNumber = 35; + } +} + +pub type FinancialCollective = pallet_collective::Instance3; +impl pallet_collective::Config for Runtime { + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type MotionDuration = financial_council_timings::FinancialCouncilMotionDuration; + type MaxProposals = FinancialCouncilMaxProposals; + type MaxMembers = FinancialCouncilMaxMembers; + type DefaultVote = pallet_collective::PrimeDefaultVote; + type WeightInfo = pallet_collective::weights::SubstrateWeight; + type SetMembersOrigin = EnsureRoot; + type MaxProposalWeight = MaxCollectivesProposalWeight; +} + +pub type FinancialCollectiveMembership = pallet_membership::Instance3; +impl pallet_membership::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type AddOrigin = RootOrMoreThanHalfCouncil; + type RemoveOrigin = RootOrMoreThanHalfCouncil; + type SwapOrigin = RootOrMoreThanHalfCouncil; + type ResetOrigin = EnsureRoot; + type PrimeOrigin = RootOrMoreThanHalfCouncil; + type MembershipInitialized = TechnicalCommittee; + type MembershipChanged = TechnicalCommittee; + type MaxMembers = FinancialCouncilMaxMembers; + type WeightInfo = pallet_membership::weights::SubstrateWeight; +} + +pub type FinancialCouncilMember = pallet_collective::EnsureMember; + +pub type RootOrFinancialCouncilMember = + EitherOfDiverse, FinancialCouncilMember>; + +pub type AllFinancialCouncil = + pallet_collective::EnsureProportionAtLeast; + +pub type RootOrAllFinancialCouncil = EitherOfDiverse, AllFinancialCouncil>; --- a/runtime/common/config/governance/mod.rs +++ b/runtime/common/config/governance/mod.rs @@ -49,6 +49,9 @@ pub mod technical_committee; pub use technical_committee::*; +pub mod financial_council; +pub use financial_council::*; + pub mod fellowship; pub use fellowship::*; --- a/runtime/common/config/pallets/foreign_asset.rs +++ b/runtime/common/config/pallets/foreign_asset.rs @@ -40,10 +40,10 @@ type RuntimeEvent = RuntimeEvent; #[cfg(feature = "governance")] - type ForceRegisterOrigin = governance::RootOrTechnicalCommitteeMember; + type ManagerOrigin = governance::RootOrFinancialCouncilMember; #[cfg(not(feature = "governance"))] - type ForceRegisterOrigin = EnsureRoot; + type ManagerOrigin = EnsureRoot; type PalletId = ForeignAssetPalletId; type SelfLocation = SelfLocation; --- a/runtime/common/construct_runtime.rs +++ b/runtime/common/construct_runtime.rs @@ -81,6 +81,12 @@ Scheduler: pallet_scheduler = 49, #[cfg(feature = "governance")] + FinancialCouncil: pallet_collective:: = 97, + + #[cfg(feature = "governance")] + FinancialCouncilMembership: pallet_membership:: = 98, + + #[cfg(feature = "governance")] Origins: pallet_gov_origins = 99, // XCM helpers. --- a/runtime/opal/src/governance_timings.rs +++ b/runtime/opal/src/governance_timings.rs @@ -52,3 +52,11 @@ pub TechnicalMotionDuration: BlockNumber = 15 * MINUTES; } } + +pub mod financial_council { + use super::*; + + parameter_types! { + pub FinancialCouncilMotionDuration: BlockNumber = 15 * MINUTES; + } +} --- a/runtime/quartz/src/governance_timings.rs +++ b/runtime/quartz/src/governance_timings.rs @@ -52,3 +52,11 @@ pub TechnicalMotionDuration: BlockNumber = 3 * DAYS; } } + +pub mod financial_council { + use super::*; + + parameter_types! { + pub FinancialCouncilMotionDuration: BlockNumber = 3 * DAYS; + } +} --- a/runtime/unique/src/governance_timings.rs +++ b/runtime/unique/src/governance_timings.rs @@ -52,3 +52,11 @@ pub TechnicalMotionDuration: BlockNumber = 3 * DAYS; } } + +pub mod financial_council { + use super::*; + + parameter_types! { + pub FinancialCouncilMotionDuration: BlockNumber = 3 * DAYS; + } +}