Bound Unsigned when signed is not supported. (#6367)

* bound unsigned when necessary

* convert more type to AtLeast32BitUnsigned

* Update primitives/arithmetic/src/traits.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* doc refactor

* line reorganize

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Guillaume Thiolliere
2020-06-25 11:30:20 +02:00
committed by GitHub
parent b17ccf24a8
commit 44fb311f1f
16 changed files with 84 additions and 74 deletions
@@ -61,7 +61,7 @@
//! ```
use crate::offchain::storage::StorageValueRef;
use crate::traits::AtLeast32Bit;
use crate::traits::AtLeast32BitUnsigned;
use codec::{Codec, Decode, Encode};
use sp_core::offchain::{Duration, Timestamp};
use sp_io::offchain;
@@ -430,7 +430,7 @@ where
/// used with [`BlockAndTime<BlockNumberProvider>`](BlockAndTime).
pub trait BlockNumberProvider {
/// Type of `BlockNumber` to provide.
type BlockNumber: Codec + Clone + Ord + Eq + AtLeast32Bit;
type BlockNumber: Codec + Clone + Ord + Eq + AtLeast32BitUnsigned;
/// Returns the current block number.
///
/// Provides an abstraction over an arbitrary way of providing the