Nonlinear locking and cleanups (#2733)

* Nonlinear locking and cleanups

* Bump runtime version

* Minor cleanup

* Fix tests

* Fix council tests

* Fix flaw in turnout counting

* fix: lock_voting_should_work_with_delegation test

* chore: fix comment refering to unexisting function
This commit is contained in:
Gavin Wood
2019-06-03 16:47:48 +02:00
committed by GitHub
parent 7885068fac
commit b88c46bfd1
7 changed files with 696 additions and 415 deletions
+16 -3
View File
@@ -21,7 +21,7 @@
#![recursion_limit="256"]
use rstd::prelude::*;
use support::construct_runtime;
use support::{construct_runtime, parameter_types};
use substrate_primitives::u32_trait::{_2, _4};
use node_primitives::{
AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, AuthorityId, Signature, AuthoritySignature
@@ -58,7 +58,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("node"),
impl_name: create_runtime_str!("substrate-node"),
authoring_version: 10,
spec_version: 89,
spec_version: 90,
impl_version: 90,
apis: RUNTIME_API_VERSIONS,
};
@@ -150,10 +150,23 @@ impl staking::Trait for Runtime {
type Reward = ();
}
const MINUTES: BlockNumber = 6;
const BUCKS: Balance = 1_000_000_000_000;
parameter_types! {
pub const LaunchPeriod: BlockNumber = 28 * 24 * 60 * MINUTES;
pub const VotingPeriod: BlockNumber = 28 * 24 * 60 * MINUTES;
pub const MinimumDeposit: Balance = 100 * BUCKS;
pub const EnactmentPeriod: BlockNumber = 30 * 24 * 60 * MINUTES;
}
impl democracy::Trait for Runtime {
type Currency = Balances;
type Proposal = Call;
type Event = Event;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
type MinimumDeposit = MinimumDeposit;
}
impl council::Trait for Runtime {