Aggregate all liquidity restrictions in a single place (#1921)

* Clean up session key rotation

* Fix build

* Bump version

* Introduce feature to balances.

* Move staking locking logic over to central point

* ^^^ rest

* First part of assimilation

* More assimilation

* More assimilation

* Fix most tests

* Fix build

* Move Balances to new locking system

* :q!

* Bump runtime version

* Build runtime

* Convenience function

* Test fix.

* Whitespace

* Improve type legibility.

* Fix comment.

* More tests.

* More tests.

* Bump version

* Caps

* Whitespace

* Whitespace

* Remove unneeded function.
This commit is contained in:
Gav Wood
2019-03-06 12:46:17 +01:00
committed by GitHub
parent 46541ec73c
commit ccc11974ee
62 changed files with 795 additions and 346 deletions
+2 -4
View File
@@ -6,14 +6,13 @@ edition = "2018"
[dependencies]
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde = { version = "1.0", optional = true }
parity-codec = { version = "3.1", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
srml-support = { path = "../support", default-features = false }
system = { package = "srml-system", path = "../system", default-features = false }
consensus = { package = "srml-consensus", path = "../consensus", default-features = false }
[dev-dependencies]
runtime_io = { package = "sr-io", path = "../../core/sr-io" }
@@ -25,8 +24,7 @@ std = [
"rstd/std",
"srml-support/std",
"runtime_primitives/std",
"consensus/std",
"serde/std",
"serde",
"parity-codec/std",
"system/std",
"inherents/std",
+5 -10
View File
@@ -32,17 +32,17 @@
#![cfg_attr(not(feature = "std"), no_std)]
use parity_codec::Encode;
#[cfg(feature = "std")]
use parity_codec::Decode;
use parity_codec::Encode;
#[cfg(feature = "std")]
use inherents::ProvideInherentData;
use srml_support::{StorageValue, Parameter, decl_storage, decl_module};
use srml_support::for_each_tuple;
use runtime_primitives::traits::{As, SimpleArithmetic, Zero};
use system::ensure_inherent;
use rstd::{result, ops::{Mul, Div}, cmp};
use inherents::{RuntimeString, InherentIdentifier, ProvideInherent, IsFatalError, InherentData};
#[cfg(feature = "std")]
use inherents::ProvideInherentData;
/// The identifier for the `timestamp` inherent.
pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"timstap0";
@@ -144,7 +144,7 @@ macro_rules! impl_timestamp_set {
for_each_tuple!(impl_timestamp_set);
pub trait Trait: consensus::Trait + system::Trait {
pub trait Trait: system::Trait {
/// Type used for expressing timestamp.
type Moment: Parameter + Default + SimpleArithmetic
+ Mul<Self::BlockNumber, Output = Self::Moment>
@@ -259,7 +259,7 @@ mod tests {
use substrate_primitives::H256;
use runtime_primitives::BuildStorage;
use runtime_primitives::traits::{BlakeTwo256, IdentityLookup};
use runtime_primitives::testing::{Digest, DigestItem, Header, UintAuthorityId};
use runtime_primitives::testing::{Digest, DigestItem, Header};
impl_outer_origin! {
pub enum Origin for Test {}
@@ -280,11 +280,6 @@ mod tests {
type Event = ();
type Log = DigestItem;
}
impl consensus::Trait for Test {
type Log = DigestItem;
type SessionKey = UintAuthorityId;
type InherentOfflineReport = ();
}
impl Trait for Test {
type Moment = u64;
type OnTimestampSet = ();