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 Preimages = Preimage;
75}
76
77impl pallet_referenda::Config for Runtime {
78 type WeightInfo = weights::pallet_referenda_referenda::WeightInfo<Self>;
79 type RuntimeCall = RuntimeCall;
80 type RuntimeEvent = RuntimeEvent;
81 type Scheduler = Scheduler;
82 type Currency = Balances;
83 type SubmitOrigin = frame_system::EnsureSigned<AccountId>;
84 type CancelOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumCanceller>;
85 type KillOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumKiller>;
86 type Slash = Treasury;
87 type Votes = pallet_conviction_voting::VotesOf<Runtime>;
88 type Tally = pallet_conviction_voting::TallyOf<Runtime>;
89 type SubmissionDeposit = SubmissionDeposit;
90 type MaxQueued = ConstU32<100>;
91 type UndecidingTimeout = UndecidingTimeout;
92 type AlarmInterval = AlarmInterval;
93 type Tracks = TracksInfo;
94 type Preimages = Preimage;
95 type BlockNumberProvider = System;
96}