From d9cbf46c988109820ed182576dacb0841b570de4 Mon Sep 17 00:00:00 2001 From: Francisco Valentim Castilho Date: Mon, 20 May 2024 01:30:22 -0300 Subject: [PATCH] Fix: Changes on council and tracks params --- tinkernet/runtime/src/governance/councils.rs | 11 +++++++---- tinkernet/runtime/src/governance/mod.rs | 16 ++++++++-------- tinkernet/runtime/src/governance/tracks.rs | 4 ++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/tinkernet/runtime/src/governance/councils.rs b/tinkernet/runtime/src/governance/councils.rs index 06c8224..e4b07c3 100644 --- a/tinkernet/runtime/src/governance/councils.rs +++ b/tinkernet/runtime/src/governance/councils.rs @@ -5,8 +5,11 @@ use super::*; pub type TinkerCouncil = pallet_collective::Instance1; parameter_types! { - // TODO: Check value of this parameter pub MaxProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block; + pub MaxMotionDuration: u32 = 3 * DAYS ; + pub MaxProposals: u32 = 20; + pub MaxMembers: u32 = 5; + } impl pallet_collective::Config for Runtime { @@ -15,11 +18,11 @@ impl pallet_collective::Config for Runtime { type Proposal = RuntimeCall; /// The maximum amount of time (in blocks) council members to vote on motions. /// Motions may end in fewer blocks if enough votes are cast to determine the result. - type MotionDuration = ConstU32<{ 3 * DAYS }>; + type MotionDuration = MaxMotionDuration; /// The maximum number of proposals that can be open in council at once. - type MaxProposals = ConstU32<20>; + type MaxProposals = MaxProposals; /// The maximum number of council members. - type MaxMembers = ConstU32<7>; + type MaxMembers = MaxMembers; type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote; type WeightInfo = pallet_collective::weights::SubstrateWeight; type SetMembersOrigin = EitherOf; diff --git a/tinkernet/runtime/src/governance/mod.rs b/tinkernet/runtime/src/governance/mod.rs index 0c1314b..2b63636 100644 --- a/tinkernet/runtime/src/governance/mod.rs +++ b/tinkernet/runtime/src/governance/mod.rs @@ -5,7 +5,6 @@ use super::*; use frame_support::{parameter_types, traits::EitherOf}; use frame_system::EnsureRootWithSuccess; -use polkadot_runtime_common::prod_or_fast; mod origins; pub use origins::{ @@ -18,7 +17,7 @@ pub use tracks::TracksInfo; mod councils; parameter_types! { - pub const VoteLockingPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1); + pub const VoteLockingPeriod: BlockNumber = 7 * DAYS; } impl pallet_conviction_voting::Config for Runtime { @@ -34,7 +33,7 @@ impl pallet_conviction_voting::Config for Runtime { parameter_types! { pub const AlarmInterval: BlockNumber = 1; - pub const SubmissionDeposit: Balance = 1 * UNIT; + pub const SubmissionDeposit: Balance = UNIT; pub const UndecidingTimeout: BlockNumber = 14 * DAYS; } @@ -42,16 +41,16 @@ parameter_types! { pub const MaxBalance: Balance = Balance::max_value(); } -pub type TreasurySpender = EitherOf, Spender>; -pub type RootOrGeneralManagement = EitherOf, GeneralManagement>; - pub type AllCouncil = pallet_collective::EnsureProportionAtLeast; +pub type CouncilMoreThanApprove = + pallet_collective::EnsureProportionMoreThan; pub type ConcilHalf = pallet_collective::EnsureProportionAtLeast; pub type CouncilThreeFifths = pallet_collective::EnsureProportionAtLeast; +pub type TreasurySpender = EitherOf, Spender>; +pub type RootOrGeneralManagement = EitherOf, GeneralManagement>; pub type CouncilApproveOrigin = EitherOf, CouncilThreeFifths>; - pub type CouncilRejectOrigin = EitherOf, ConcilHalf>; impl pallet_custom_origins::Config for Runtime {} @@ -72,7 +71,8 @@ impl pallet_referenda::Config for Runtime { type Scheduler = Scheduler; type Currency = Balances; type SubmitOrigin = frame_system::EnsureSigned; - type CancelOrigin = EitherOf, ReferendumCanceller>, AllCouncil>; + type CancelOrigin = + EitherOf, ReferendumCanceller>, CouncilMoreThanApprove>; type KillOrigin = EitherOf, ReferendumKiller>, AllCouncil>; type Slash = Treasury; type Votes = pallet_conviction_voting::VotesOf; diff --git a/tinkernet/runtime/src/governance/tracks.rs b/tinkernet/runtime/src/governance/tracks.rs index 757384e..dfcf7c4 100644 --- a/tinkernet/runtime/src/governance/tracks.rs +++ b/tinkernet/runtime/src/governance/tracks.rs @@ -88,7 +88,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] pallet_referenda::TrackInfo { name: "general_management", max_deciding: 10, - decision_deposit: 20 * GRAND, + decision_deposit: 10 * GRAND, #[cfg(not(feature = "on-chain-release-build"))] prepare_period: 4 * MINUTES, #[cfg(feature = "on-chain-release-build")] @@ -114,7 +114,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] pallet_referenda::TrackInfo { name: "council_admin", max_deciding: 10, - decision_deposit: 5 * GRAND, + decision_deposit: 10 * GRAND, #[cfg(not(feature = "on-chain-release-build"))] prepare_period: 4 * MINUTES, #[cfg(feature = "on-chain-release-build")]