Companion PR to 5802 (#1050)

This commit is contained in:
Alexander Popiak
2020-05-14 17:20:07 +02:00
committed by GitHub
parent 45f64055a4
commit cb1e21cb0c
5 changed files with 542 additions and 513 deletions
+522 -511
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -12,6 +12,7 @@ log = { version = "0.3.9", optional = true }
rustc-hex = { version = "2.0.1", default-features = false } rustc-hex = { version = "2.0.1", default-features = false }
serde = { version = "1.0.102", default-features = false } serde = { version = "1.0.102", default-features = false }
serde_derive = { version = "1.0.102", optional = true } serde_derive = { version = "1.0.102", optional = true }
static_assertions = "1.1.0"
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
+9 -1
View File
@@ -60,6 +60,7 @@ use im_online::sr25519::AuthorityId as ImOnlineId;
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
use session::{historical as session_historical}; use session::{historical as session_historical};
use static_assertions::const_assert;
#[cfg(feature = "std")] #[cfg(feature = "std")]
pub use staking::StakerStatus; pub use staking::StakerStatus;
@@ -372,6 +373,7 @@ impl democracy::Trait for Runtime {
parameter_types! { parameter_types! {
pub const CouncilMotionDuration: BlockNumber = 3 * DAYS; pub const CouncilMotionDuration: BlockNumber = 3 * DAYS;
pub const CouncilMaxProposals: u32 = 100;
} }
type CouncilCollective = collective::Instance1; type CouncilCollective = collective::Instance1;
@@ -380,17 +382,21 @@ impl collective::Trait<CouncilCollective> for Runtime {
type Proposal = Call; type Proposal = Call;
type Event = Event; type Event = Event;
type MotionDuration = CouncilMotionDuration; type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
} }
const DESIRED_MEMBERS: u32 = 13;
parameter_types! { parameter_types! {
pub const CandidacyBond: Balance = 1 * DOLLARS; pub const CandidacyBond: Balance = 1 * DOLLARS;
pub const VotingBond: Balance = 5 * CENTS; pub const VotingBond: Balance = 5 * CENTS;
/// Daily council elections. /// Daily council elections.
pub const TermDuration: BlockNumber = 24 * HOURS; pub const TermDuration: BlockNumber = 24 * HOURS;
pub const DesiredMembers: u32 = 13; pub const DesiredMembers: u32 = DESIRED_MEMBERS;
pub const DesiredRunnersUp: u32 = 7; pub const DesiredRunnersUp: u32 = 7;
pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect"; pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect";
} }
// Make sure that there are no more than MAX_MEMBERS members elected via phragmen.
const_assert!(DESIRED_MEMBERS <= collective::MAX_MEMBERS);
impl elections_phragmen::Trait for Runtime { impl elections_phragmen::Trait for Runtime {
type Event = Event; type Event = Event;
@@ -411,6 +417,7 @@ impl elections_phragmen::Trait for Runtime {
parameter_types! { parameter_types! {
pub const TechnicalMotionDuration: BlockNumber = 3 * DAYS; pub const TechnicalMotionDuration: BlockNumber = 3 * DAYS;
pub const TechnicalMaxProposals: u32 = 100;
} }
type TechnicalCollective = collective::Instance2; type TechnicalCollective = collective::Instance2;
@@ -419,6 +426,7 @@ impl collective::Trait<TechnicalCollective> for Runtime {
type Proposal = Call; type Proposal = Call;
type Event = Event; type Event = Event;
type MotionDuration = TechnicalMotionDuration; type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
} }
impl membership::Trait<membership::Instance1> for Runtime { impl membership::Trait<membership::Instance1> for Runtime {
+1
View File
@@ -12,6 +12,7 @@ log = { version = "0.3.9", optional = true }
rustc-hex = { version = "2.0.1", default-features = false } rustc-hex = { version = "2.0.1", default-features = false }
serde = { version = "1.0.102", default-features = false } serde = { version = "1.0.102", default-features = false }
serde_derive = { version = "1.0.102", optional = true } serde_derive = { version = "1.0.102", optional = true }
static_assertions = "1.1.0"
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
+9 -1
View File
@@ -62,6 +62,7 @@ use im_online::sr25519::AuthorityId as ImOnlineId;
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
use session::historical as session_historical; use session::historical as session_historical;
use static_assertions::const_assert;
#[cfg(feature = "std")] #[cfg(feature = "std")]
pub use staking::StakerStatus; pub use staking::StakerStatus;
@@ -377,6 +378,7 @@ impl democracy::Trait for Runtime {
parameter_types! { parameter_types! {
pub const CouncilMotionDuration: BlockNumber = 7 * DAYS; pub const CouncilMotionDuration: BlockNumber = 7 * DAYS;
pub const CouncilMaxProposals: u32 = 100;
} }
type CouncilCollective = collective::Instance1; type CouncilCollective = collective::Instance1;
@@ -385,18 +387,22 @@ impl collective::Trait<CouncilCollective> for Runtime {
type Proposal = Call; type Proposal = Call;
type Event = Event; type Event = Event;
type MotionDuration = CouncilMotionDuration; type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
} }
const DESIRED_MEMBERS: u32 = 13;
parameter_types! { parameter_types! {
pub const CandidacyBond: Balance = 100 * DOLLARS; pub const CandidacyBond: Balance = 100 * DOLLARS;
pub const VotingBond: Balance = 5 * DOLLARS; pub const VotingBond: Balance = 5 * DOLLARS;
/// Weekly council elections initially, later monthly. /// Weekly council elections initially, later monthly.
pub const TermDuration: BlockNumber = 7 * DAYS; pub const TermDuration: BlockNumber = 7 * DAYS;
/// 13 members initially, to be increased to 23 eventually. /// 13 members initially, to be increased to 23 eventually.
pub const DesiredMembers: u32 = 13; pub const DesiredMembers: u32 = DESIRED_MEMBERS;
pub const DesiredRunnersUp: u32 = 20; pub const DesiredRunnersUp: u32 = 20;
pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect"; pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect";
} }
// Make sure that there are no more than MAX_MEMBERS members elected via phragmen.
const_assert!(DESIRED_MEMBERS <= collective::MAX_MEMBERS);
impl elections_phragmen::Trait for Runtime { impl elections_phragmen::Trait for Runtime {
type Event = Event; type Event = Event;
@@ -417,6 +423,7 @@ impl elections_phragmen::Trait for Runtime {
parameter_types! { parameter_types! {
pub const TechnicalMotionDuration: BlockNumber = 7 * DAYS; pub const TechnicalMotionDuration: BlockNumber = 7 * DAYS;
pub const TechnicalMaxProposals: u32 = 100;
} }
type TechnicalCollective = collective::Instance2; type TechnicalCollective = collective::Instance2;
@@ -425,6 +432,7 @@ impl collective::Trait<TechnicalCollective> for Runtime {
type Proposal = Call; type Proposal = Call;
type Event = Event; type Event = Event;
type MotionDuration = TechnicalMotionDuration; type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
} }
impl membership::Trait<membership::Instance1> for Runtime { impl membership::Trait<membership::Instance1> for Runtime {