difftreelog
feat add financial council
in: master
8 files changed
pallets/foreign-assets/src/lib.rsdiffbeforeafterboth--- a/pallets/foreign-assets/src/lib.rs
+++ b/pallets/foreign-assets/src/lib.rs
@@ -68,7 +68,7 @@
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// Origin for force registering of a foreign asset.
- type ForceRegisterOrigin: EnsureOrigin<Self::RuntimeOrigin>;
+ type ManagerOrigin: EnsureOrigin<Self::RuntimeOrigin>;
/// The ID of the foreign assets pallet.
type PalletId: Get<PalletId>;
@@ -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()
runtime/common/config/governance/financial_council.rsdiffbeforeafterboth1use super::*;23parameter_types! {4 pub FinancialCouncilMaxProposals: u32 = 100;5 pub FinancialCouncilMaxMembers: u32 = 100;6}78#[cfg(not(feature = "gov-test-timings"))]9use crate::governance_timings::financial_council as financial_council_timings;1011#[cfg(feature = "gov-test-timings")]12pub mod financial_council_timings {13 use super::*;1415 parameter_types! {16 pub FinancialCouncilMotionDuration: BlockNumber = 35;17 }18}1920pub type FinancialCollective = pallet_collective::Instance3;21impl pallet_collective::Config<FinancialCollective> for Runtime {22 type RuntimeOrigin = RuntimeOrigin;23 type Proposal = RuntimeCall;24 type RuntimeEvent = RuntimeEvent;25 type MotionDuration = financial_council_timings::FinancialCouncilMotionDuration;26 type MaxProposals = FinancialCouncilMaxProposals;27 type MaxMembers = FinancialCouncilMaxMembers;28 type DefaultVote = pallet_collective::PrimeDefaultVote;29 type WeightInfo = pallet_collective::weights::SubstrateWeight<Runtime>;30 type SetMembersOrigin = EnsureRoot<AccountId>;31 type MaxProposalWeight = MaxCollectivesProposalWeight;32}3334pub type FinancialCollectiveMembership = pallet_membership::Instance3;35impl pallet_membership::Config<FinancialCollectiveMembership> for Runtime {36 type RuntimeEvent = RuntimeEvent;37 type AddOrigin = RootOrMoreThanHalfCouncil;38 type RemoveOrigin = RootOrMoreThanHalfCouncil;39 type SwapOrigin = RootOrMoreThanHalfCouncil;40 type ResetOrigin = EnsureRoot<AccountId>;41 type PrimeOrigin = RootOrMoreThanHalfCouncil;42 type MembershipInitialized = TechnicalCommittee;43 type MembershipChanged = TechnicalCommittee;44 type MaxMembers = FinancialCouncilMaxMembers;45 type WeightInfo = pallet_membership::weights::SubstrateWeight<Runtime>;46}4748pub type FinancialCouncilMember = pallet_collective::EnsureMember<AccountId, FinancialCollective>;4950pub type RootOrFinancialCouncilMember =51 EitherOfDiverse<EnsureRoot<AccountId>, FinancialCouncilMember>;5253pub type AllFinancialCouncil =54 pallet_collective::EnsureProportionAtLeast<AccountId, FinancialCollective, 1, 1>;5556pub type RootOrAllFinancialCouncil = EitherOfDiverse<EnsureRoot<AccountId>, AllFinancialCouncil>;runtime/common/config/governance/mod.rsdiffbeforeafterboth--- 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::*;
runtime/common/config/pallets/foreign_asset.rsdiffbeforeafterboth--- 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<Self::AccountId>;
+ type ManagerOrigin = EnsureRoot<Self::AccountId>;
type PalletId = ForeignAssetPalletId;
type SelfLocation = SelfLocation;
runtime/common/construct_runtime.rsdiffbeforeafterboth--- 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::<Instance3> = 97,
+
+ #[cfg(feature = "governance")]
+ FinancialCouncilMembership: pallet_membership::<Instance3> = 98,
+
+ #[cfg(feature = "governance")]
Origins: pallet_gov_origins = 99,
// XCM helpers.
runtime/opal/src/governance_timings.rsdiffbeforeafterboth--- 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;
+ }
+}
runtime/quartz/src/governance_timings.rsdiffbeforeafterboth--- 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;
+ }
+}
runtime/unique/src/governance_timings.rsdiffbeforeafterboth--- 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;
+ }
+}