westend_runtime/governance/
mod.rs1use super::*;
20use crate::xcm_config::Collectives;
21use frame_support::{parameter_types, traits::EitherOf};
22use frame_system::EnsureRootWithSuccess;
23use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
24use xcm::latest::BodyId;
25
26mod origins;
27pub use origins::{
28 pallet_custom_origins, AuctionAdmin, FellowshipAdmin, GeneralAdmin, LeaseAdmin,
29 ReferendumCanceller, ReferendumKiller, Spender, StakingAdmin, Treasurer, WhitelistedCaller,
30};
31mod tracks;
32pub use tracks::TracksInfo;
33
34parameter_types! {
35 pub const VoteLockingPeriod: BlockNumber = 7 * DAYS;
36}
37
38impl pallet_conviction_voting::Config for Runtime {
39 type WeightInfo = weights::pallet_conviction_voting::WeightInfo<Self>;
40 type RuntimeEvent = RuntimeEvent;
41 type Currency = Balances;
42 type VoteLockingPeriod = VoteLockingPeriod;
43 type MaxVotes = ConstU32<512>;
44 type MaxTurnout =
45 frame_support::traits::tokens::currency::ActiveIssuanceOf<Balances, Self::AccountId>;
46 type Polls = Referenda;
47 type BlockNumberProvider = System;
48 type VotingHooks = ();
49}
50
51parameter_types! {
52 pub const AlarmInterval: BlockNumber = 1;
53 pub const SubmissionDeposit: Balance = 1 * 3 * CENTS;
54 pub const UndecidingTimeout: BlockNumber = 14 * DAYS;
55}
56
57parameter_types! {
58 pub const MaxBalance: Balance = Balance::max_value();
59}
60pub type TreasurySpender = EitherOf<EnsureRootWithSuccess<AccountId, MaxBalance>, Spender>;
61
62impl origins::pallet_custom_origins::Config for Runtime {}
63
64parameter_types! {
65 pub const FellowsBodyId: BodyId = BodyId::Technical;
67}
68
69impl pallet_whitelist::Config for Runtime {
70 type WeightInfo = weights::pallet_whitelist::WeightInfo<Self>;
71 type RuntimeCall = RuntimeCall;
72 type RuntimeEvent = RuntimeEvent;
73 type WhitelistOrigin = EitherOfDiverse<
74 EnsureRoot<Self::AccountId>,
75 EnsureXcm<IsVoiceOfBody<Collectives, FellowsBodyId>>,
76 >;
77 type DispatchWhitelistedOrigin = EitherOf<EnsureRoot<Self::AccountId>, WhitelistedCaller>;
78 type Preimages = Preimage;
79}
80
81impl pallet_referenda::Config for Runtime {
82 type WeightInfo = weights::pallet_referenda_referenda::WeightInfo<Self>;
83 type RuntimeCall = RuntimeCall;
84 type RuntimeEvent = RuntimeEvent;
85 type Scheduler = Scheduler;
86 type Currency = Balances;
87 type SubmitOrigin = frame_system::EnsureSigned<AccountId>;
88 type CancelOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumCanceller>;
89 type KillOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumKiller>;
90 type Slash = Treasury;
91 type Votes = pallet_conviction_voting::VotesOf<Runtime>;
92 type Tally = pallet_conviction_voting::TallyOf<Runtime>;
93 type SubmissionDeposit = SubmissionDeposit;
94 type MaxQueued = ConstU32<100>;
95 type UndecidingTimeout = UndecidingTimeout;
96 type AlarmInterval = AlarmInterval;
97 type Tracks = TracksInfo;
98 type Preimages = Preimage;
99 type BlockNumberProvider = System;
100}