use super::*;
use crate::currency::{GLMR, SUPPLY_FACTOR};
use frame_support::traits::{EitherOf, MapSuccess};
use frame_system::EnsureRootWithSuccess;
use sp_runtime::traits::Replace;
parameter_types! {
pub const VoteLockingPeriod: BlockNumber = 1 * DAYS;
}
impl pallet_conviction_voting::Config for Runtime {
type WeightInfo = moonbeam_weights::pallet_conviction_voting::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Polls = Referenda;
type MaxTurnout = frame_support::traits::TotalIssuanceOf<Balances, Self::AccountId>;
type MaxVotes = ConstU32<20>;
type VoteLockingPeriod = VoteLockingPeriod;
}
parameter_types! {
pub const AlarmInterval: BlockNumber = 1;
pub const SubmissionDeposit: Balance = 10 * GLMR * SUPPLY_FACTOR;
pub const UndecidingTimeout: BlockNumber = 21 * DAYS;
}
pub type GeneralAdminOrRoot = EitherOf<EnsureRoot<AccountId>, origins::GeneralAdmin>;
pub type FastGeneralAdminOrRoot = EitherOf<EnsureRoot<AccountId>, origins::FastGeneralAdmin>;
impl custom_origins::Config for Runtime {}
impl pallet_whitelist::Config for Runtime {
type WeightInfo = moonbeam_weights::pallet_whitelist::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WhitelistOrigin = EitherOf<
EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>,
MapSuccess<
pallet_collective::EnsureProportionAtLeast<
Self::AccountId,
OpenTechCommitteeInstance,
5,
9,
>,
Replace<ConstU16<6>>,
>,
>;
type DispatchWhitelistedOrigin = EitherOf<EnsureRoot<Self::AccountId>, WhitelistedCaller>;
type Preimages = Preimage;
}
pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber);
impl pallet_referenda::Config for Runtime {
type WeightInfo = moonbeam_weights::pallet_referenda::WeightInfo<Runtime>;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type Scheduler = Scheduler;
type Currency = Balances;
type SubmitOrigin = frame_system::EnsureSigned<AccountId>;
type CancelOrigin = EitherOf<EnsureRoot<Self::AccountId>, ReferendumCanceller>;
type KillOrigin = EitherOf<EnsureRoot<Self::AccountId>, ReferendumKiller>;
type Slash = Treasury;
type Votes = pallet_conviction_voting::VotesOf<Runtime>;
type Tally = pallet_conviction_voting::TallyOf<Runtime>;
type SubmissionDeposit = SubmissionDeposit;
type MaxQueued = ConstU32<100>;
type UndecidingTimeout = UndecidingTimeout;
type AlarmInterval = AlarmInterval;
type Tracks = TracksInfo;
type Preimages = Preimage;
}