Skip to content

Commit

Permalink
configured
Browse files Browse the repository at this point in the history
  • Loading branch information
asiniscalchi committed Sep 4, 2024
1 parent 2b4400a commit 9767277
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
9 changes: 9 additions & 0 deletions runtime/laos/src/configs/collective_council.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ pub const COUNCIL_MOTION_DURATION: BlockNumber = 5 * MINUTES;
#[cfg(not(feature = "fast-mode"))]
pub const COUNCIL_MOTION_DURATION: BlockNumber = 7 * DAYS;

pub type CouncilMajority =
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>;
pub type AllOfCouncil =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 1>;
pub type TwoThirdOfCouncil =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>;
pub type HalfOfCouncil =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>;

parameter_types! {
pub const CouncilMotionDuration: BlockNumber = COUNCIL_MOTION_DURATION;
pub const CouncilMaxProposals: u32 = 7;
Expand Down
12 changes: 6 additions & 6 deletions runtime/laos/src/configs/democracy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use super::collective_council::{
AllOfCouncil, CouncilCollective, HalfOfCouncil, TwoThirdOfCouncil,
};
use crate::{
currency::UNIT, weights, AccountId, Balance, BlockNumber, OriginCaller, Preimage, Runtime,
RuntimeEvent, Scheduler, Treasury,
currency::UNIT, weights, AccountId, Balance, Balances, BlockNumber, OriginCaller, Preimage,
Runtime, RuntimeEvent, Scheduler, Treasury,
};
use frame_support::parameter_types;
use frame_support::{parameter_types, traits::EitherOfDiverse};
use frame_system::{EnsureRoot, EnsureSigned};
use parachains_common::{DAYS, HOURS, MINUTES};
use polkadot_runtime_common::prod_or_fast;
Expand All @@ -29,7 +29,7 @@ impl pallet_democracy::Config for Runtime {
type CancelProposalOrigin = EnsureRoot<AccountId>;
// To cancel a proposal which has been passed, 2/3 of the council must agree to
// it.
type CancellationOrigin = EnsureRootOr<TwoThirdOfCouncil>;
type CancellationOrigin = EitherOfDiverse<EnsureRoot<AccountId>, TwoThirdOfCouncil>;
/// Period in blocks where an external proposal may not be re-submitted
/// after being vetoed.
type CooloffPeriod = CooloffPeriod;
Expand All @@ -52,10 +52,10 @@ impl pallet_democracy::Config for Runtime {
type ExternalOrigin = HalfOfCouncil;
/// Half of the council can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = EnsureRootOr<HalfOfCouncil>;
type FastTrackOrigin = EitherOfDiverse<EnsureRoot<AccountId>, HalfOfCouncil>;
type FastTrackVotingPeriod = FastTrackVotingPeriod;
type InstantAllowed = InstantAllowed;
type InstantOrigin = EnsureRootOr<AllOfCouncil>;
type InstantOrigin = EitherOfDiverse<EnsureRoot<AccountId>, AllOfCouncil>;
// Same as EnactmentPeriod
/// How often (in blocks) new public referenda are launched.
type LaunchPeriod = LaunchPeriod;
Expand Down
4 changes: 1 addition & 3 deletions runtime/laos/src/configs/treasury.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::collective_council::CouncilCollective;
use super::collective_council::CouncilMajority;
use crate::{
currency::UNIT, weights, AccountId, Balance, Balances, BlockNumber, Permill, Runtime,
RuntimeEvent, Treasury,
Expand Down Expand Up @@ -34,8 +34,6 @@ parameter_types! {
pub TreasuryAccount: AccountId = Treasury::account_id();
}

type CouncilMajority =
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>;
type ApproveOrigin = EitherOfDiverse<EnsureRoot<AccountId>, CouncilMajority>;
type RejectOrigin = EitherOfDiverse<EnsureRoot<AccountId>, CouncilMajority>;

Expand Down
1 change: 1 addition & 0 deletions runtime/laos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ construct_runtime!(
Treasury: pallet_treasury = 41,
Elections: pallet_elections_phragmen = 42,
Preimage: pallet_preimage = 43,
Democracy: pallet_democracy = 45,

// Frontier
Ethereum: pallet_ethereum = 50,
Expand Down

0 comments on commit 9767277

Please sign in to comment.