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
+6 -4
View File
@@ -50,7 +50,7 @@ use sp_std::prelude::*;
use sp_std::fmt::Debug;
use codec::{Encode, Decode};
use sp_runtime::{DispatchResult, RuntimeDebug, traits::{
StaticLookup, Zero, SimpleArithmetic, MaybeSerializeDeserialize, Saturating, Convert
StaticLookup, Zero, AtLeast32Bit, MaybeSerializeDeserialize, Saturating, Convert
}};
use frame_support::{decl_module, decl_event, decl_storage, decl_error};
use frame_support::traits::{
@@ -85,8 +85,8 @@ pub struct VestingInfo<Balance, BlockNumber> {
}
impl<
Balance: SimpleArithmetic + Copy,
BlockNumber: SimpleArithmetic + Copy,
Balance: AtLeast32Bit + Copy,
BlockNumber: AtLeast32Bit + Copy,
> VestingInfo<Balance, BlockNumber> {
/// Amount locked at block `n`.
pub fn locked_at<
@@ -298,7 +298,9 @@ mod tests {
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sp_runtime::{
Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup, Identity, OnInitialize},
Perbill,
testing::Header,
traits::{BlakeTwo256, IdentityLookup, Identity, OnInitialize},
};
use sp_storage::Storage;