Browse Source

Merge pull request #1817 from ondratra/council_constants_exposure

Council constants exposure
Bedeho Mender 4 years ago
parent
commit
3c964bbe27

+ 0 - 1
node/src/service.rs

@@ -15,7 +15,6 @@
 // along with Joystream node.  If not, see <http://www.gnu.org/licenses/>.
 
 #![warn(unused_extern_crates)]
-
 // Substrate implementation issue.
 #![allow(clippy::redundant_closure_call)]
 

+ 20 - 0
runtime-modules/council/src/lib.rs

@@ -399,6 +399,26 @@ decl_module! {
         /// Setup events
         fn deposit_event() = default;
 
+        /// Minimum number of extra candidates needed for the valid election.
+        /// Number of total candidates is equal to council size plus extra candidates.
+        const MinNumberOfExtraCandidates: u64 = T::MinNumberOfExtraCandidates::get();
+        /// Council member count
+        const CouncilSize: u64 = T::CouncilSize::get();
+        /// Minimum stake candidate has to lock
+        const MinCandidateStake: Balance<T> = T::MinCandidateStake::get();
+        /// Duration of annoncing period
+        const AnnouncingPeriodDuration: T::BlockNumber = T::AnnouncingPeriodDuration::get();
+        /// Duration of idle period
+        const IdlePeriodDuration: T::BlockNumber = T::IdlePeriodDuration::get();
+        /// The value elected members will be awarded each block of their reign.
+        const ElectedMemberRewardPerBlock: Balance<T> = T::ElectedMemberRewardPerBlock::get();
+        /// Interval for automatic reward payments.
+        const ElectedMemberRewardPeriod: T::BlockNumber = T::ElectedMemberRewardPeriod::get();
+        /// Amount that will be added to the budget balance on every refill.
+        const BudgetRefillAmount: Balance<T> = T::BudgetRefillAmount::get();
+        /// Interval between automatic budget refills.
+        const BudgetRefillPeriod: T::BlockNumber = T::BudgetRefillPeriod::get();
+
         /////////////////// Lifetime ///////////////////////////////////////////
 
         // No origin so this is a priviledged call

+ 11 - 0
runtime-modules/referendum/src/lib.rs

@@ -322,6 +322,17 @@ decl_module! {
         /// Setup events
         fn deposit_event() = default;
 
+        /// Maximum length of vote commitment salt. Use length that ensures uniqueness for hashing e.g. std::u64::MAX.
+        const MaxSaltLength: u64 = T::MaxSaltLength::get();
+        /// Identifier for currency locks used for staking.
+        const LockId: LockIdentifier = T::LockId::get();
+        /// Duration of voting stage (number of blocks)
+        const VoteStageDuration: T::BlockNumber = T::VoteStageDuration::get();
+        /// Duration of revealing stage (number of blocks)
+        const RevealStageDuration: T::BlockNumber = T::RevealStageDuration::get();
+        /// Minimum stake needed for voting
+        const MinimumStake: Balance<T, I> = T::MinimumStake::get();
+
         /////////////////// Lifetime ///////////////////////////////////////////
 
         // No origin so this is a priviledged call

+ 0 - 1
runtime/src/primitives.rs

@@ -1,7 +1,6 @@
 //! Low-level types used throughout the Substrate code.
 
 #![warn(missing_docs)]
-
 #![cfg_attr(not(feature = "std"), no_std)]
 
 use sp_runtime::{