-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
technical committee + small refactoring of
CouncilMajority
- Loading branch information
Showing
5 changed files
with
57 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
use crate::{weights, AccountId, BlockNumber, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin}; | ||
use frame_support::{pallet_prelude::Weight, parameter_types, traits::EitherOfDiverse}; | ||
use frame_system::EnsureRoot; | ||
use laos_primitives::RuntimeBlockWeights; | ||
#[cfg(not(feature = "fast-mode"))] | ||
use parachains_common::DAYS; | ||
#[cfg(feature = "fast-mode")] | ||
use parachains_common::MINUTES; | ||
use sp_runtime::Perbill; | ||
|
||
#[cfg(feature = "fast-mode")] | ||
pub const MOTION_DURATION: BlockNumber = 5 * MINUTES; | ||
#[cfg(not(feature = "fast-mode"))] | ||
pub const MOTION_DURATION: BlockNumber = 7 * DAYS; | ||
|
||
parameter_types! { | ||
pub const MotionDuration: BlockNumber = MOTION_DURATION; | ||
pub const MaxProposals: u32 = 7; | ||
pub const MaxMembers: u32 = 20; | ||
pub MaxProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block; | ||
} | ||
|
||
pub type CouncilMajority = | ||
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>; | ||
|
||
pub type CouncilCollective = pallet_collective::Instance1; | ||
impl pallet_collective::Config<CouncilCollective> for Runtime { | ||
type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote; | ||
type MaxMembers = MaxMembers; | ||
type MaxProposalWeight = MaxProposalWeight; | ||
type MaxProposals = MaxProposals; | ||
type MotionDuration = MotionDuration; | ||
type Proposal = RuntimeCall; | ||
type RuntimeEvent = RuntimeEvent; | ||
type RuntimeOrigin = RuntimeOrigin; | ||
type SetMembersOrigin = EnsureRoot<AccountId>; | ||
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>; | ||
} | ||
|
||
#[allow(dead_code)] // TODO remove me when integrating https://github.com/freeverseio/laos/pull/759 | ||
pub type TechnicalCommittee = pallet_collective::Instance2; | ||
impl pallet_collective::Config<TechnicalCommittee> for Runtime { | ||
type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote; | ||
type MaxMembers = MaxMembers; | ||
type MaxProposalWeight = MaxProposalWeight; | ||
type MaxProposals = MaxProposals; | ||
type MotionDuration = MotionDuration; | ||
type Proposal = RuntimeCall; | ||
type RuntimeEvent = RuntimeEvent; | ||
type RuntimeOrigin = RuntimeOrigin; | ||
// the root or a turnout of 50%+1 of the council can select the technical committee | ||
type SetMembersOrigin = EitherOfDiverse<EnsureRoot<AccountId>, CouncilMajority>; | ||
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters