git.delta.rocks / unique-network / refs/commits / 5ef1c1c9c81a

difftreelog

source

runtime/common/config/governance/council.rs2.5 KiBsourcehistory
1use super::*;23parameter_types! {4	pub CouncilMaxProposals: u32 = 100;5	pub CouncilMaxMembers: u32 = 100;6}78#[cfg(not(feature = "gov-test-timings"))]9use crate::governance_timings::council as council_timings;1011#[cfg(feature = "gov-test-timings")]12pub mod council_timings {13	use super::*;1415	parameter_types! {16		pub CouncilMotionDuration: BlockNumber = 35;17	}18}1920pub type CouncilCollective = pallet_collective::Instance1;21impl pallet_collective::Config<CouncilCollective> for Runtime {22	type RuntimeOrigin = RuntimeOrigin;23	type Proposal = RuntimeCall;24	type RuntimeEvent = RuntimeEvent;25	type MotionDuration = council_timings::CouncilMotionDuration;26	type MaxProposals = CouncilMaxProposals;27	type MaxMembers = CouncilMaxMembers;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 CouncilCollectiveMembership = pallet_membership::Instance1;35impl pallet_membership::Config<CouncilCollectiveMembership> for Runtime {36	type RuntimeEvent = RuntimeEvent;37	type AddOrigin = EnsureRoot<AccountId>;38	type RemoveOrigin = EnsureRoot<AccountId>;39	type SwapOrigin = EnsureRoot<AccountId>;40	type ResetOrigin = EnsureRoot<AccountId>;41	type PrimeOrigin = EnsureRoot<AccountId>;42	type MembershipInitialized = Council;43	type MembershipChanged = Council;44	type MaxMembers = CouncilMaxMembers;45	type WeightInfo = pallet_membership::weights::SubstrateWeight<Runtime>;46}4748pub type CouncilMember = pallet_collective::EnsureMember<AccountId, CouncilCollective>;4950pub type OneThirdsCouncil =51	pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 3>;5253pub type HalfCouncil =54	pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>;5556pub type MoreThanHalfCouncil =57	pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>;5859pub type ThreeFourthsCouncil = EnsureProportionAtLeast<AccountId, CouncilCollective, 3, 4>;6061pub type AllCouncil = EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>;6263pub type RootOrOneThirdsCouncil = EitherOfDiverse<EnsureRoot<AccountId>, OneThirdsCouncil>;6465pub type RootOrHalfCouncil = EitherOfDiverse<EnsureRoot<AccountId>, HalfCouncil>;6667pub type RootOrMoreThanHalfCouncil = EitherOfDiverse<EnsureRoot<AccountId>, MoreThanHalfCouncil>;6869pub type RootOrThreeFourthsCouncil = EitherOfDiverse<EnsureRoot<AccountId>, ThreeFourthsCouncil>;7071pub type RootOrAllCouncil = EitherOfDiverse<EnsureRoot<AccountId>, AllCouncil>;