浏览代码

short election stages for testing runtime, drop alternate runtime spec names

Mokhtar Naamani 3 年之前
父节点
当前提交
201a5c9998
共有 3 个文件被更改,包括 21 次插入23 次删除
  1. 0 2
      node/Cargo.toml
  2. 0 11
      node/src/command.rs
  3. 21 10
      runtime/src/lib.rs

+ 0 - 2
node/Cargo.toml

@@ -111,5 +111,3 @@ runtime-benchmarks = [
 	"node-runtime/runtime-benchmarks",
 	"frame-benchmarking-cli",
 ]
-staging_runtime = []
-testing_runtime = []

+ 0 - 11
node/src/command.rs

@@ -37,21 +37,10 @@ impl SubstrateCli for Cli {
         2019
     }
 
-    #[cfg(not(any(feature = "staging_runtime", feature = "testing_runtime")))]
     fn executable_name() -> String {
         "joystream-node".into()
     }
 
-    #[cfg(feature = "staging_runtime")]
-    fn executable_name() -> String {
-        "joystream-node (staging runtime)".into()
-    }
-
-    #[cfg(feature = "testing_runtime")]
-    fn executable_name() -> String {
-        "joystream-node (testing runtime)".into()
-    }
-
     fn impl_version() -> String {
         env!("SUBSTRATE_CLI_IMPL_VERSION").into()
     }

+ 21 - 10
runtime/src/lib.rs

@@ -95,12 +95,7 @@ pub use content::MaxNumber;
 
 /// This runtime version.
 pub const VERSION: RuntimeVersion = RuntimeVersion {
-    #[cfg(not(any(feature = "staging_runtime", feature = "testing_runtime")))]
     spec_name: create_runtime_str!("joystream-node"),
-    #[cfg(feature = "staging_runtime")]
-    spec_name: create_runtime_str!("joystream-node-staging"),
-    #[cfg(feature = "testing_runtime")]
-    spec_name: create_runtime_str!("joystream-node-testing"),
     impl_name: create_runtime_str!("joystream-node"),
     authoring_version: 10,
     spec_version: 5,
@@ -533,8 +528,9 @@ parameter_types! {
     pub const MaxWinnerTargetCount: u64 = 10; // should be greater than council size
 }
 
-// Common staging and testing coucil and elections configuration
-#[cfg(any(feature = "staging_runtime", feature = "testing_runtime"))]
+// Common staging and playground coucil and elections configuration
+// CouncilSize is defined separately
+#[cfg(feature = "staging_runtime")]
 parameter_types! {
     // referendum parameters
     pub const MaxSaltLength: u64 = 32;
@@ -553,24 +549,39 @@ parameter_types! {
     pub const MaxWinnerTargetCount: u64 = 10;
 }
 
-// Staging network council size
+// Staging council size
 #[cfg(feature = "staging_runtime")]
 #[cfg(not(feature = "playground_runtime"))]
 parameter_types! {
     pub const CouncilSize: u64 = 5;
 }
 
-// Staging but customized for playground council size
+// Playground council size
 #[cfg(feature = "staging_runtime")]
 #[cfg(feature = "playground_runtime")]
 parameter_types! {
     pub const CouncilSize: u64 = 1;
 }
 
-// Testing council size
+// Testing config
 #[cfg(feature = "testing_runtime")]
 parameter_types! {
+    // referendum parameters
+    pub const MaxSaltLength: u64 = 32;
+    pub const VoteStageDuration: BlockNumber = 20;
+    pub const RevealStageDuration: BlockNumber = 20;
+    pub const MinimumVotingStake: u64 = 10000;
+
+    // council parameteres
+    pub const MinNumberOfExtraCandidates: u64 = 1;
+    pub const AnnouncingPeriodDuration: BlockNumber = 20;
+    pub const IdlePeriodDuration: BlockNumber = 20;
     pub const CouncilSize: u64 = 5;
+    pub const MinCandidateStake: u64 = 11000;
+    pub const ElectedMemberRewardPeriod: BlockNumber = 14400;
+    pub const DefaultBudgetIncrement: u64 = 10000000;
+    pub const BudgetRefillPeriod: BlockNumber = 1000;
+    pub const MaxWinnerTargetCount: u64 = 10;
 }
 
 impl referendum::Trait<ReferendumInstance> for Runtime {