1234567891011121314151617use frame_support::{18 PalletId, parameter_types,19 traits::{20 EnsureOrigin, EqualPrivilegeOnly, EitherOfDiverse, EitherOf, MapSuccess, ConstU16, Polling,21 },22 weights::Weight,23 pallet_prelude::*,24};25use frame_system::{EnsureRoot, EnsureNever};26use sp_runtime::{27 Perbill,28 traits::{AccountIdConversion, ConstU32, Replace, CheckedSub, Convert},29 morph_types,30};31use crate::{32 Runtime, RuntimeOrigin, RuntimeEvent, RuntimeCall, OriginCaller, Preimage, Balances, Treasury,33 Scheduler, Council, TechnicalCommittee,34};35pub use up_common::{36 constants::{UNIQUE, DAYS, HOURS, MINUTES, CENTIUNIQUE},37 types::{AccountId, Balance, BlockNumber},38};39use pallet_collective::EnsureProportionAtLeast;4041pub mod council;42pub use council::*;4344pub mod democracy;45pub use democracy::*;4647pub mod technical_committee;48pub use technical_committee::*;4950pub mod fellowship;51pub use fellowship::*;5253pub mod scheduler;54pub use scheduler::*;5556impl pallet_gov_origins::Config for Runtime {}5758morph_types! {59 60 61 pub type CheckedReduceBy<N: TypedGet>: TryMorph = |r: N::Type| -> Result<N::Type, ()> {62 r.checked_sub(&N::get()).ok_or(())63 } where N::Type: CheckedSub;64}6566parameter_types! {67 pub MaxCollectivesProposalWeight: Weight = Perbill::from_percent(80) * <Runtime as frame_system::Config>::BlockWeights::get().max_block;68}