Per-things trait. (#4904)

* Give perthigns the trait it always deserved.

* Make staking and phragmen work with the new generic per_thing

* Make everything work together 🔨

* a bit of cleanup

* Clean usage

* Bump.

* Fix name

* fix grumbles

* hopefully fix the ui test

* Some grumbles

* revamp traits again

* Better naming again.
This commit is contained in:
Kian Paimani
2020-02-13 13:09:33 +01:00
committed by GitHub
parent e6454eb091
commit c871eaacbc
42 changed files with 346 additions and 241 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ use parking_lot::Mutex;
use sp_runtime::{
generic::BlockId,
traits::{Block as BlockT, NumberFor, SimpleArithmetic, Extrinsic},
traits::{Block as BlockT, NumberFor, AtLeast32Bit, Extrinsic},
};
use sp_transaction_pool::{
TransactionPool, PoolStatus, ImportNotificationStream,
@@ -223,7 +223,7 @@ struct RevalidationAction {
revalidate_amount: Option<usize>,
}
impl<N: Clone + Copy + SimpleArithmetic> RevalidationStrategy<N> {
impl<N: Clone + Copy + AtLeast32Bit> RevalidationStrategy<N> {
pub fn clear(&mut self) {
if let Self::Light(status) = self {
status.clear()
@@ -255,7 +255,7 @@ impl<N: Clone + Copy + SimpleArithmetic> RevalidationStrategy<N> {
}
}
impl<N: Clone + Copy + SimpleArithmetic> RevalidationStatus<N> {
impl<N: Clone + Copy + AtLeast32Bit> RevalidationStatus<N> {
/// Called when revalidation is completed.
pub fn clear(&mut self) {
*self = Self::NotScheduled;