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