From dc012e402446377e99c978a09e77993a4a5ccd49 Mon Sep 17 00:00:00 2001 From: clangenb <37865735+clangenb@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:49:13 +0200 Subject: [PATCH] Add trait bounds to config: `Index: Default`, `BlockNumber: AtLeast32BitsUnsigned` (#648) * add `AtLeast32BitUnsigned` trait bound for `Config::BlockNumber` * add default trait bound for `Config::Index` --- primitives/src/config/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/primitives/src/config/mod.rs b/primitives/src/config/mod.rs index c3fa4c3e4..cc1de2eef 100644 --- a/primitives/src/config/mod.rs +++ b/primitives/src/config/mod.rs @@ -34,7 +34,7 @@ pub trait Config { /// transactions associated with a sender account. /// This type enforces the (de)serialization implementation /// also in no-std mode (unlike substrates MaybeSerializeDeserialize). - type Index: Debug + Copy + DeserializeOwned + AtLeast32Bit + Decode; + type Index: Default + Debug + Copy + DeserializeOwned + AtLeast32Bit + Decode; /// The block number type used by the runtime. type BlockNumber: Debug @@ -45,7 +45,8 @@ pub trait Config { + DeserializeOwned + core::hash::Hash + core::str::FromStr - + Into; + + Into + + AtLeast32BitUnsigned; /// The output of the `Hashing` function. type Hash: Debug