Browse Source

Change min_validator_count() limit in the codex

Shamil Gadelshin 5 years ago
parent
commit
e8dbdcb502

+ 1 - 4
runtime-modules/proposals/codex/src/lib.rs

@@ -75,9 +75,6 @@ pub trait Trait:
     + roles::actors::Trait
     + staking::Trait
 {
-    /// Defines min allowed validator count for the 'Set validator count' proposal.
-    type SetValidatorCountProposalMinValidators: Get<u32>;
-
     /// Defines max allowed text proposal length.
     type TextProposalMaxLength: Get<u32>;
 
@@ -499,7 +496,7 @@ decl_module! {
             new_validator_count: u32,
         ) {
             ensure!(
-                new_validator_count >= T::SetValidatorCountProposalMinValidators::get(),
+                new_validator_count >= <staking::Module<T>>::minimum_validator_count(),
                 Error::LessThanMinValidatorCount
             );
 

+ 0 - 1
runtime-modules/proposals/codex/src/tests/mock.rs

@@ -157,7 +157,6 @@ impl VotersParameters for MockVotersParameters {
 
 parameter_types! {
     pub const TextProposalMaxLength: u32 = 20_000;
-    pub const SetValidatorCountProposalMinValidators: u32 = 4;
     pub const RuntimeUpgradeWasmProposalMaxLength: u32 = 20_000;
     pub const RuntimeUpgradeProposalAllowedProposers: Vec<u64> = vec![1];
 }

+ 0 - 1
runtime/src/lib.rs

@@ -859,7 +859,6 @@ impl proposals_discussion::Trait for Runtime {
 
 parameter_types! {
     pub const TextProposalMaxLength: u32 = 60_000;
-    pub const SetValidatorCountProposalMinValidators: u32 = 4;
     pub const RuntimeUpgradeWasmProposalMaxLength: u32 = 2_000_000;
     pub const RuntimeUpgradeProposalAllowedProposers: Vec<u64> = Vec::new(); //TODO set allowed members
 }