moonbase_runtime/governance/
referenda.rs1use super::moonbase_weights;
24use super::*;
25use crate::currency::*;
26use frame_support::traits::{EitherOf, MapSuccess};
27use frame_system::EnsureRootWithSuccess;
28use sp_runtime::traits::Replace;
29
30parameter_types! {
31 pub const VoteLockingPeriod: BlockNumber = 1 * DAYS;
32}
33
34impl pallet_conviction_voting::Config for Runtime {
35 type WeightInfo = moonbase_weights::pallet_conviction_voting::WeightInfo<Runtime>;
36 type RuntimeEvent = RuntimeEvent;
37 type Currency = Balances;
38 type Polls = Referenda;
39 type MaxTurnout = frame_support::traits::TotalIssuanceOf<Balances, Self::AccountId>;
40 type MaxVotes = ConstU32<20>;
42 type VoteLockingPeriod = VoteLockingPeriod;
44 type BlockNumberProvider = System;
45 type VotingHooks = ();
46}
47
48parameter_types! {
49 pub const AlarmInterval: BlockNumber = 1;
50 pub const SubmissionDeposit: Balance = 10 * UNIT * SUPPLY_FACTOR;
51 pub const UndecidingTimeout: BlockNumber = 21 * DAYS;
52}
53
54pub type GeneralAdminOrRoot = EitherOf<EnsureRoot<AccountId>, origins::GeneralAdmin>;
55
56pub type FastGeneralAdminOrRoot =
58 EitherOf<EnsureRoot<AccountId>, EitherOf<origins::GeneralAdmin, origins::FastGeneralAdmin>>;
59
60impl custom_origins::Config for Runtime {}
61
62impl pallet_whitelist::Config for Runtime {
65 type WeightInfo = moonbase_weights::pallet_whitelist::WeightInfo<Runtime>;
66 type RuntimeEvent = RuntimeEvent;
67 type RuntimeCall = RuntimeCall;
68 type WhitelistOrigin = EitherOf<
69 EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>,
70 MapSuccess<
71 pallet_collective::EnsureProportionAtLeast<
72 Self::AccountId,
73 OpenTechCommitteeInstance,
74 5,
75 9,
76 >,
77 Replace<ConstU16<6>>,
78 >,
79 >;
80 type DispatchWhitelistedOrigin = EitherOf<EnsureRoot<Self::AccountId>, WhitelistedCaller>;
81 type Preimages = Preimage;
82}
83
84impl pallet_referenda::Config for Runtime {
85 type WeightInfo = moonbase_weights::pallet_referenda::WeightInfo<Runtime>;
86 type RuntimeCall = RuntimeCall;
87 type RuntimeEvent = RuntimeEvent;
88 type Scheduler = Scheduler;
89 type Currency = Balances;
90 type SubmitOrigin = frame_system::EnsureSigned<AccountId>;
91 type CancelOrigin = EitherOf<EnsureRoot<Self::AccountId>, ReferendumCanceller>;
92 type KillOrigin = EitherOf<EnsureRoot<Self::AccountId>, ReferendumKiller>;
93 type Slash = Treasury;
94 type Votes = pallet_conviction_voting::VotesOf<Runtime>;
95 type Tally = pallet_conviction_voting::TallyOf<Runtime>;
96 type SubmissionDeposit = SubmissionDeposit;
97 type MaxQueued = ConstU32<100>;
98 type UndecidingTimeout = UndecidingTimeout;
99 type AlarmInterval = AlarmInterval;
100 type Tracks = TracksInfo;
101 type Preimages = Preimage;
102 type BlockNumberProvider = System;
103}