Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
19b67cd
Export GRANDPA AuthorityPair when full_crypto is enabled (#4872)
h4x3rotab Feb 10, 2020
8b6b093
Create Benchmarking Setup for Identity Pallet #4695 (#4818)
shawntabrizi Feb 10, 2020
f735d3e
Fix vesting logic (#4864)
gavofyork Feb 10, 2020
7e8ac2e
Update trie-db to the latest (#4874)
cecton Feb 10, 2020
ae03ee9
Fix timer panics in the wasm light client (#4561)
expenses Feb 10, 2020
0d4586b
Don't expose `Benchmarking` host functions by default (#4875)
bkchr Feb 10, 2020
571e3c4
Add trace on import block. (#4871)
seerscode Feb 10, 2020
1fa3f7f
Refactor and document allocator (#4855)
pepyakin Feb 10, 2020
d472cd6
Avoid challenging those that can't be suspended anyway (#4804)
gavofyork Feb 10, 2020
b388338
Add trait to get module and call names. (#4854)
seerscode Feb 10, 2020
26a4b73
Fix runtime-interface tests on windows (#4805)
bkchr Feb 10, 2020
613a3bc
update primitive types to 0.6.2 (#4866)
NikVolf Feb 10, 2020
671cb85
Run offchain workers at hash, not number. (#4878)
tomusdrw Feb 10, 2020
50bb62f
Use prefixed iterator from trie. (#4858)
cheme Feb 11, 2020
a5a61df
Add support for json output in subkey (#4882)
hbakkum-dotstar Feb 11, 2020
1dd662b
impl Randomness trait for Babe and remove unused RandomBeacon trait (…
rphmeier Feb 11, 2020
60f0569
Pause Kademlia if too many connections (#4828)
tomaka Feb 11, 2020
657484a
Refactor tx factory 1 (#4870)
seerscode Feb 11, 2020
7647c39
pallet-evm: optional nonce parameter (#4893)
sorpaas Feb 11, 2020
d0e354a
Increase the penality for being offline (#4889)
tomaka Feb 11, 2020
00a400f
Add a sub command to generate a node key file (#4884)
hbakkum-dotstar Feb 11, 2020
10332c9
Benchmark Timestamp Pallet (#4891)
seerscode Feb 12, 2020
f5f7852
Add command-line flag to enable yamux flow control. (#4892)
twittner Feb 12, 2020
2723b9c
Do not allow zero Existential Deposit when using Balances (#4894)
shawntabrizi Feb 12, 2020
ea721a1
network: Use "one shot" protocol handler. (#3520)
twittner Feb 12, 2020
2290645
Benchmark the Balances Pallet (#4879)
shawntabrizi Feb 12, 2020
e1668c2
client/network-gossip: Integrate GossipEngine tasks into Future impl …
mxinden Feb 12, 2020
b955d17
add some more docs on PreRuntime digests (#4896)
rphmeier Feb 12, 2020
1b42f24
serialize partial_fee into string (#4898)
xlc Feb 12, 2020
47076a9
add sr25519 bench (#4905)
NikVolf Feb 12, 2020
d78534e
Fix chain-spec and make sure it does not breaks again (#4906)
bkchr Feb 13, 2020
b01bd0d
Full block import benchmark (#4865)
NikVolf Feb 13, 2020
d940c02
Per-things trait. (#4904)
kianenigma Feb 13, 2020
0b2ae97
executor: Migrate wasmtime backend to a high-level API (#4686)
pepyakin Feb 13, 2020
b36497a
reference sc-service with rocksdb feature (#4918)
NikVolf Feb 13, 2020
067c884
pallet-evm: add support for transaction-level create2 (#4907)
sorpaas Feb 13, 2020
7d544ef
pallet-evm: refactor duplicate code in call/create/create2 (#4922)
sorpaas Feb 13, 2020
d02c720
Adds a test to ensure that we clear the heap between calls into runti…
bkchr Feb 14, 2020
29454c3
Composite accounts (#4820)
gavofyork Feb 14, 2020
a6e7c05
Allow to distinguish out of gas from other traps (#4883)
athei Feb 14, 2020
16bb192
Adds fork-awareness and finalization notifications to transaction poo…
seunlanlege Feb 14, 2020
b27d50c
Adds `with_pair!` macro to application-crypto (#4885)
bkchr Feb 14, 2020
877e193
Remove rename for finalized event and add some docs. (#4930)
tomusdrw Feb 15, 2020
7aba7ff
Merged commit '877e193b314d42c9d77bb1740e70656b26bd0ff9' from Substrate
hoani Feb 16, 2020
9469920
Reverted #4820 (substrate), add doughnut and delegatedDispatchVerifie…
hoani Feb 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
kianenigma authored Feb 13, 2020
commit d940c02440f80c5e0ded092c4dbc9f048312d8a6
2 changes: 1 addition & 1 deletion bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use sp_std::prelude::*;
use sp_core::OpaqueMetadata;
use sp_runtime::{
ApplyExtrinsicResult, transaction_validity::TransactionValidity, generic, create_runtime_str,
impl_opaque_keys, MultiSignature
impl_opaque_keys, MultiSignature,
};
use sp_runtime::traits::{
BlakeTwo256, Block as BlockT, StaticLookup, Verify, ConvertInto, IdentifyAccount
Expand Down
6 changes: 3 additions & 3 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub use node_primitives::{AccountId, Signature};
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment};
use sp_api::impl_runtime_apis;
use sp_runtime::{
Permill, Perbill, Percent, ApplyExtrinsicResult, impl_opaque_keys, generic, create_runtime_str,
BenchmarkResults,
Permill, Perbill, Percent, ApplyExtrinsicResult, BenchmarkResults,
impl_opaque_keys, generic, create_runtime_str,
};
use sp_runtime::curve::PiecewiseLinear;
use sp_runtime::transaction_validity::TransactionValidity;
Expand Down Expand Up @@ -83,7 +83,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 216,
impl_version: 2,
impl_version: 3,
apis: RUNTIME_API_VERSIONS,
};

Expand Down
6 changes: 3 additions & 3 deletions bin/node/transaction-factory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ use sp_consensus::block_import::BlockImport;
use codec::{Decode, Encode};
use sp_runtime::generic::BlockId;
use sp_runtime::traits::{
Block as BlockT, Header as HeaderT, SimpleArithmetic, One, Zero,
Block as BlockT, Header as HeaderT, AtLeast32Bit, One, Zero,
};

pub trait RuntimeAdapter {
type AccountId: Display;
type Balance: Display + SimpleArithmetic + From<Self::Number>;
type Balance: Display + AtLeast32Bit + From<Self::Number>;
type Block: BlockT;
type Index: Copy;
type Number: Display + PartialOrd + SimpleArithmetic + Zero + One;
type Number: Display + PartialOrd + AtLeast32Bit + Zero + One;
type Phase: Copy;
type Secret;

Expand Down
12 changes: 6 additions & 6 deletions client/src/cht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use codec::Encode;
use sp_trie;

use sp_core::{H256, convert_hash};
use sp_runtime::traits::{Header as HeaderT, SimpleArithmetic, Zero, One};
use sp_runtime::traits::{Header as HeaderT, AtLeast32Bit, Zero, One};
use sp_state_machine::{
MemoryDB, TrieBackend, Backend as StateBackend, StorageProof, InMemoryBackend,
prove_read_on_trie_backend, read_proof_check, read_proof_check_on_proving_backend
Expand All @@ -48,7 +48,7 @@ pub fn size<N: From<u32>>() -> N {
/// Returns Some(cht_number) if CHT is need to be built when the block with given number is canonized.
pub fn is_build_required<N>(cht_size: N, block_num: N) -> Option<N>
where
N: Clone + SimpleArithmetic,
N: Clone + AtLeast32Bit,
{
let block_cht_num = block_to_cht_number(cht_size.clone(), block_num.clone())?;
let two = N::one() + N::one();
Expand All @@ -66,7 +66,7 @@ pub fn is_build_required<N>(cht_size: N, block_num: N) -> Option<N>
/// Returns Some(max_cht_number) if CHT has ever been built given maximal canonical block number.
pub fn max_cht_number<N>(cht_size: N, max_canonical_block: N) -> Option<N>
where
N: Clone + SimpleArithmetic,
N: Clone + AtLeast32Bit,
{
let max_cht_number = block_to_cht_number(cht_size, max_canonical_block)?;
let two = N::one() + N::one();
Expand Down Expand Up @@ -291,18 +291,18 @@ fn build_pairs<Header, I>(
/// More generally: CHT N includes block (1 + N*SIZE)...((N+1)*SIZE).
/// This is because the genesis hash is assumed to be known
/// and including it would be redundant.
pub fn start_number<N: SimpleArithmetic>(cht_size: N, cht_num: N) -> N {
pub fn start_number<N: AtLeast32Bit>(cht_size: N, cht_num: N) -> N {
(cht_num * cht_size) + N::one()
}

/// Get the ending block of a given CHT.
pub fn end_number<N: SimpleArithmetic>(cht_size: N, cht_num: N) -> N {
pub fn end_number<N: AtLeast32Bit>(cht_size: N, cht_num: N) -> N {
(cht_num + N::one()) * cht_size
}

/// Convert a block number to a CHT number.
/// Returns `None` for `block_num` == 0, `Some` otherwise.
pub fn block_to_cht_number<N: SimpleArithmetic>(cht_size: N, block_num: N) -> Option<N> {
pub fn block_to_cht_number<N: AtLeast32Bit>(cht_size: N, block_num: N) -> Option<N> {
if block_num == N::zero() {
None
} else {
Expand Down
6 changes: 3 additions & 3 deletions client/src/leaves.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use std::collections::BTreeMap;
use std::cmp::Reverse;
use kvdb::{KeyValueDB, DBTransaction};
use sp_runtime::traits::SimpleArithmetic;
use sp_runtime::traits::AtLeast32Bit;
use codec::{Encode, Decode};
use sp_blockchain::{Error, Result};

Expand Down Expand Up @@ -65,7 +65,7 @@ pub struct LeafSet<H, N> {

impl<H, N> LeafSet<H, N> where
H: Clone + PartialEq + Decode + Encode,
N: std::fmt::Debug + Clone + SimpleArithmetic + Decode + Encode,
N: std::fmt::Debug + Clone + AtLeast32Bit + Decode + Encode,
{
/// Construct a new, blank leaf set.
pub fn new() -> Self {
Expand Down Expand Up @@ -251,7 +251,7 @@ pub struct Undo<'a, H: 'a, N: 'a> {

impl<'a, H: 'a, N: 'a> Undo<'a, H, N> where
H: Clone + PartialEq + Decode + Encode,
N: std::fmt::Debug + Clone + SimpleArithmetic + Decode + Encode,
N: std::fmt::Debug + Clone + AtLeast32Bit + Decode + Encode,
{
/// Undo an imported block by providing the displaced leaf.
pub fn undo_import(&mut self, displaced: ImportDisplaced<H, N>) {
Expand Down
6 changes: 3 additions & 3 deletions client/src/light/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use codec::{Decode, Encode};
use sp_core::{convert_hash, traits::CodeExecutor};
use sp_runtime::traits::{
Block as BlockT, Header as HeaderT, Hash, HashFor, NumberFor,
SimpleArithmetic, CheckedConversion,
AtLeast32Bit, CheckedConversion,
};
use sp_state_machine::{
ChangesTrieRootsStorage, ChangesTrieAnchorBlockId, ChangesTrieConfigurationRange,
Expand Down Expand Up @@ -286,15 +286,15 @@ impl<E, Block, H, S> FetchChecker<Block> for LightDataChecker<E, H, Block, S>
}

/// A view of BTreeMap<Number, Hash> as a changes trie roots storage.
struct RootsStorage<'a, Number: SimpleArithmetic, Hash: 'a> {
struct RootsStorage<'a, Number: AtLeast32Bit, Hash: 'a> {
roots: (Number, &'a [Hash]),
prev_roots: &'a BTreeMap<Number, Hash>,
}

impl<'a, H, Number, Hash> ChangesTrieRootsStorage<H, Number> for RootsStorage<'a, Number, Hash>
where
H: Hasher,
Number: ::std::fmt::Display + ::std::hash::Hash + Clone + SimpleArithmetic + Encode + Decode + Send + Sync + 'static,
Number: ::std::fmt::Display + ::std::hash::Hash + Clone + AtLeast32Bit + Encode + Decode + Send + Sync + 'static,
Hash: 'a + Send + Sync + Clone + AsRef<[u8]>,
{
fn build_anchor(
Expand Down
6 changes: 3 additions & 3 deletions client/transaction-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions frame/assets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
#![cfg_attr(not(feature = "std"), no_std)]

use frame_support::{Parameter, decl_module, decl_event, decl_storage, decl_error, ensure};
use sp_runtime::traits::{Member, SimpleArithmetic, Zero, StaticLookup};
use sp_runtime::traits::{Member, AtLeast32Bit, Zero, StaticLookup};
use frame_system::{self as system, ensure_signed};
use sp_runtime::traits::One;

Expand All @@ -143,10 +143,10 @@ pub trait Trait: frame_system::Trait {
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;

/// The units in which we record balances.
type Balance: Member + Parameter + SimpleArithmetic + Default + Copy;
type Balance: Member + Parameter + AtLeast32Bit + Default + Copy;

/// The arithmetic type of asset identifier.
type AssetId: Parameter + SimpleArithmetic + Default + Copy;
type AssetId: Parameter + AtLeast32Bit + Default + Copy;
}

decl_module! {
Expand Down
2 changes: 1 addition & 1 deletion frame/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub use pallet_timestamp;
use sp_std::{result, prelude::*};
use frame_support::{decl_storage, decl_module, traits::{FindAuthor, Get, Randomness as RandomnessT}};
use sp_timestamp::OnTimestampSet;
use sp_runtime::{generic::DigestItem, ConsensusEngineId, Perbill};
use sp_runtime::{generic::DigestItem, ConsensusEngineId, Perbill, PerThing};
use sp_runtime::traits::{IsMember, SaturatedConversion, Saturating, Hash};
use sp_staking::{
SessionIndex,
Expand Down
2 changes: 1 addition & 1 deletion frame/babe/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use super::{Trait, Module, GenesisConfig};
use sp_consensus_babe::AuthorityId;
use sp_runtime::{
traits::IdentityLookup, Perbill, testing::{Header, UintAuthorityId}, impl_opaque_keys,
traits::IdentityLookup, Perbill, PerThing, testing::{Header, UintAuthorityId}, impl_opaque_keys,
};
use sp_version::RuntimeVersion;
use frame_support::{impl_outer_origin, parameter_types, weights::Weight};
Expand Down
6 changes: 3 additions & 3 deletions frame/balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ use frame_support::{
use sp_runtime::{
RuntimeDebug, DispatchResult, DispatchError,
traits::{
Zero, SimpleArithmetic, StaticLookup, Member, CheckedAdd, CheckedSub,
Zero, AtLeast32Bit, StaticLookup, Member, CheckedAdd, CheckedSub,
MaybeSerializeDeserialize, Saturating, Bounded,
},
};
Expand All @@ -180,7 +180,7 @@ pub use self::imbalances::{PositiveImbalance, NegativeImbalance};

pub trait Subtrait<I: Instance = DefaultInstance>: frame_system::Trait {
/// The balance of an account.
type Balance: Parameter + Member + SimpleArithmetic + Codec + Default + Copy +
type Balance: Parameter + Member + AtLeast32Bit + Codec + Default + Copy +
MaybeSerializeDeserialize + Debug;

/// A function that is invoked when the free-balance and the reserved-balance has fallen below
Expand All @@ -202,7 +202,7 @@ pub trait Subtrait<I: Instance = DefaultInstance>: frame_system::Trait {

pub trait Trait<I: Instance = DefaultInstance>: frame_system::Trait {
/// The balance of an account.
type Balance: Parameter + Member + SimpleArithmetic + Codec + Default + Copy +
type Balance: Parameter + Member + AtLeast32Bit + Codec + Default + Copy +
MaybeSerializeDeserialize + Debug;

/// A function that is invoked when the free-balance and the reserved-balance has fallen below
Expand Down
4 changes: 2 additions & 2 deletions frame/contracts/src/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use crate::{GasSpent, Module, Trait, BalanceOf, NegativeImbalanceOf};
use sp_std::convert::TryFrom;
use sp_runtime::traits::{
CheckedMul, Zero, SaturatedConversion, SimpleArithmetic, UniqueSaturatedInto,
CheckedMul, Zero, SaturatedConversion, AtLeast32Bit, UniqueSaturatedInto,
};
use frame_support::{
traits::{Currency, ExistenceRequirement, Imbalance, OnUnbalanced, WithdrawReason}, StorageValue,
Expand Down Expand Up @@ -248,7 +248,7 @@ pub fn refund_unused_gas<T: Trait>(
/// A little handy utility for converting a value in balance units into approximate value in gas units
/// at the given gas price.
pub fn approx_gas_for_balance<Balance>(gas_price: Balance, balance: Balance) -> Gas
where Balance: SimpleArithmetic
where Balance: AtLeast32Bit
{
(balance / gas_price).saturated_into::<Gas>()
}
Expand Down
9 changes: 6 additions & 3 deletions frame/elections-phragmen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@
#![cfg_attr(not(feature = "std"), no_std)]

use sp_std::prelude::*;
use sp_runtime::{print, DispatchResult, DispatchError, traits::{Zero, StaticLookup, Convert}};
use sp_runtime::{
print, DispatchResult, DispatchError, Perbill,
traits::{Zero, StaticLookup, Convert},
};
use frame_support::{
decl_storage, decl_event, ensure, decl_module, decl_error, weights::SimpleDispatchInfo,
traits::{
Expand Down Expand Up @@ -637,7 +640,7 @@ impl<T: Trait> Module<T> {
let voters_and_votes = <VotesOf<T>>::enumerate()
.map(|(v, i)| (v, i))
.collect::<Vec<(T::AccountId, Vec<T::AccountId>)>>();
let maybe_phragmen_result = sp_phragmen::elect::<_, _, _, T::CurrencyToVote>(
let maybe_phragmen_result = sp_phragmen::elect::<_, _, _, T::CurrencyToVote, Perbill>(
num_to_elect,
0,
candidates,
Expand All @@ -664,7 +667,7 @@ impl<T: Trait> Module<T> {
.filter_map(|(m, a)| if a.is_zero() { None } else { Some(m) } )
.collect::<Vec<T::AccountId>>();

let support_map = sp_phragmen::build_support_map::<_, _, _, T::CurrencyToVote>(
let support_map = sp_phragmen::build_support_map::<_, _, _, T::CurrencyToVote, Perbill>(
&new_set,
&phragmen_result.assignments,
Self::locked_stake_of,
Expand Down
3 changes: 2 additions & 1 deletion frame/example/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,8 @@ 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,
Perbill,
testing::Header,
traits::{BlakeTwo256, OnInitialize, OnFinalize, IdentityLookup},
};

Expand Down
10 changes: 5 additions & 5 deletions frame/generic-asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ use codec::{Decode, Encode, HasCompact, Input, Output, Error as CodecError};

use sp_runtime::{RuntimeDebug, DispatchResult, DispatchError};
use sp_runtime::traits::{
CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, One, Saturating, SimpleArithmetic,
CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, One, Saturating, AtLeast32Bit,
Zero, Bounded,
};

Expand All @@ -180,24 +180,24 @@ pub use self::imbalances::{NegativeImbalance, PositiveImbalance};
pub trait Trait: frame_system::Trait {
type Balance: Parameter
+ Member
+ SimpleArithmetic
+ AtLeast32Bit
+ Default
+ Copy
+ MaybeSerializeDeserialize
+ Debug;
type AssetId: Parameter + Member + SimpleArithmetic + Default + Copy;
type AssetId: Parameter + Member + AtLeast32Bit + Default + Copy;
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
}

pub trait Subtrait: frame_system::Trait {
type Balance: Parameter
+ Member
+ SimpleArithmetic
+ AtLeast32Bit
+ Default
+ Copy
+ MaybeSerializeDeserialize
+ Debug;
type AssetId: Parameter + Member + SimpleArithmetic + Default + Copy;
type AssetId: Parameter + Member + AtLeast32Bit + Default + Copy;
}

impl<T: Trait> Subtrait for T {
Expand Down
2 changes: 1 addition & 1 deletion frame/grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use sp_std::prelude::*;
use codec::{self as codec, Encode, Decode};
use frame_support::{decl_event, decl_storage, decl_module, decl_error, storage};
use sp_runtime::{
DispatchResult, generic::{DigestItem, OpaqueDigestItemId}, traits::Zero, Perbill,
DispatchResult, generic::{DigestItem, OpaqueDigestItemId}, traits::Zero, Perbill, PerThing,
};
use sp_staking::{
SessionIndex,
Expand Down
4 changes: 2 additions & 2 deletions frame/im-online/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ use pallet_session::historical::IdentificationTuple;
use sp_runtime::{
offchain::storage::StorageValueRef,
RuntimeDebug,
traits::{Convert, Member, Saturating, SimpleArithmetic}, Perbill,
traits::{Convert, Member, Saturating, AtLeast32Bit}, Perbill, PerThing,
transaction_validity::{
TransactionValidity, ValidTransaction, InvalidTransaction,
TransactionPriority,
Expand Down Expand Up @@ -151,7 +151,7 @@ struct HeartbeatStatus<BlockNumber> {
pub sent_at: BlockNumber,
}

impl<BlockNumber: PartialEq + SimpleArithmetic + Copy> HeartbeatStatus<BlockNumber> {
impl<BlockNumber: PartialEq + AtLeast32Bit + Copy> HeartbeatStatus<BlockNumber> {
/// Returns true if heartbeat has been recently sent.
///
/// Parameters:
Expand Down
4 changes: 2 additions & 2 deletions frame/indices/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use sp_std::{prelude::*, marker::PhantomData, convert::TryInto};
use codec::{Encode, Codec};
use frame_support::{Parameter, decl_module, decl_event, decl_storage};
use sp_runtime::traits::{One, SimpleArithmetic, StaticLookup, Member, LookupError};
use sp_runtime::traits::{One, AtLeast32Bit, StaticLookup, Member, LookupError};
use frame_system::{IsDeadAccount, OnNewAccount};

use self::address::Address as RawAddress;
Expand Down Expand Up @@ -59,7 +59,7 @@ impl<AccountId: Encode, AccountIndex: From<u32>>
pub trait Trait: frame_system::Trait {
/// Type used for storing an account's index; implies the maximum number of accounts the system
/// can hold.
type AccountIndex: Parameter + Member + Codec + Default + SimpleArithmetic + Copy;
type AccountIndex: Parameter + Member + Codec + Default + AtLeast32Bit + Copy;

/// Whether an account is dead or not.
type IsDeadAccount: IsDeadAccount<Self::AccountId>;
Expand Down
4 changes: 3 additions & 1 deletion frame/randomness-collective-flip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ mod tests {
use super::*;
use sp_core::H256;
use sp_runtime::{
Perbill, traits::{BlakeTwo256, OnInitialize, Header as _, IdentityLookup}, testing::Header,
Perbill,
testing::Header,
traits::{BlakeTwo256, OnInitialize, Header as _, IdentityLookup},
};
use frame_support::{impl_outer_origin, parameter_types, weights::Weight, traits::Randomness};

Expand Down
Loading