diff --git a/auction/src/lib.rs b/auction/src/lib.rs index 625c1862c..278edd146 100644 --- a/auction/src/lib.rs +++ b/auction/src/lib.rs @@ -13,6 +13,7 @@ #![allow(clippy::string_lit_as_bytes)] #![allow(clippy::unused_unit)] +use codec::MaxEncodedLen; use frame_support::pallet_prelude::*; use frame_system::{ensure_signed, pallet_prelude::*}; use orml_traits::{Auction, AuctionHandler, AuctionInfo, Change}; @@ -37,7 +38,13 @@ pub mod module { type Event: From> + IsType<::Event>; /// The balance type for bidding. - type Balance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize; + type Balance: Parameter + + Member + + AtLeast32BitUnsigned + + Default + + Copy + + MaybeSerializeDeserialize + + MaxEncodedLen; /// The auction ID type. type AuctionId: Parameter @@ -47,7 +54,8 @@ pub mod module { + Copy + MaybeSerializeDeserialize + Bounded - + codec::FullCodec; + + codec::FullCodec + + codec::MaxEncodedLen; /// The `AuctionHandler` that allow custom bidding logic and handles /// auction result. @@ -96,7 +104,6 @@ pub mod module { #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/bencher/test/src/lib.rs b/bencher/test/src/lib.rs index 3fa5b05ad..6bd2594d0 100644 --- a/bencher/test/src/lib.rs +++ b/bencher/test/src/lib.rs @@ -23,7 +23,6 @@ pub mod pallet { #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] - #[pallet::without_storage_info] pub struct Pallet(PhantomData); #[pallet::storage] diff --git a/nft/src/lib.rs b/nft/src/lib.rs index 766e1e0a1..06ec47375 100644 --- a/nft/src/lib.rs +++ b/nft/src/lib.rs @@ -66,9 +66,9 @@ pub mod module { #[pallet::config] pub trait Config: frame_system::Config { /// The class ID type - type ClassId: Parameter + Member + AtLeast32BitUnsigned + Default + Copy; + type ClassId: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen; /// The token ID type - type TokenId: Parameter + Member + AtLeast32BitUnsigned + Default + Copy; + type TokenId: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaxEncodedLen; /// The class properties type type ClassData: Parameter + Member + MaybeSerializeDeserialize; /// The token properties type diff --git a/oracle/src/lib.rs b/oracle/src/lib.rs index 9145ae112..6c59d1e82 100644 --- a/oracle/src/lib.rs +++ b/oracle/src/lib.rs @@ -19,7 +19,7 @@ #![allow(clippy::string_lit_as_bytes)] #![allow(clippy::unused_unit)] -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; @@ -55,7 +55,7 @@ pub mod module { pub(crate) type MomentOf = <>::Time as Time>::Moment; pub(crate) type TimestampedValueOf = TimestampedValue<>::OracleValue, MomentOf>; - #[derive(Encode, Decode, RuntimeDebug, Eq, PartialEq, Clone, Copy, Ord, PartialOrd, TypeInfo)] + #[derive(Encode, Decode, RuntimeDebug, Eq, PartialEq, Clone, Copy, Ord, PartialOrd, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct TimestampedValue { pub value: Value, @@ -77,10 +77,10 @@ pub mod module { type Time: Time; /// The data key type - type OracleKey: Parameter + Member; + type OracleKey: Parameter + Member + MaxEncodedLen; /// The data value type - type OracleValue: Parameter + Member + Ord; + type OracleValue: Parameter + Member + Ord + MaxEncodedLen; /// The root operator account id, record all sudo feeds on this account. type RootOperatorAccountId: Get; diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index 716cb6a4b..83499b391 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -364,7 +364,6 @@ pub mod module { #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/traits/src/auction.rs b/traits/src/auction.rs index 7f2ab7cdb..28d2e10e1 100644 --- a/traits/src/auction.rs +++ b/traits/src/auction.rs @@ -1,6 +1,6 @@ use crate::Change; use codec::FullCodec; -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::{ traits::{AtLeast32Bit, Bounded, MaybeSerializeDeserialize}, @@ -14,7 +14,7 @@ use sp_std::{ /// Auction info. #[cfg_attr(feature = "std", derive(PartialEq, Eq))] -#[derive(Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct AuctionInfo { /// Current bidder and bid price. pub bid: Option<(AccountId, Balance)>, diff --git a/utilities/src/ordered_set.rs b/utilities/src/ordered_set.rs index 32597cda0..2fab37826 100644 --- a/utilities/src/ordered_set.rs +++ b/utilities/src/ordered_set.rs @@ -1,11 +1,11 @@ -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{traits::Get, BoundedVec, DefaultNoBound}; use scale_info::TypeInfo; #[cfg(feature = "std")] use sp_std::{fmt, prelude::*}; /// An ordered set backed by `BoundedVec` -#[derive(PartialEq, Eq, Encode, Decode, DefaultNoBound, Clone, TypeInfo)] +#[derive(PartialEq, Eq, Encode, Decode, DefaultNoBound, Clone, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(S))] pub struct OrderedSet>(pub BoundedVec); diff --git a/weight-meter/src/mock.rs b/weight-meter/src/mock.rs index 2ec2f3c13..1cef5292a 100644 --- a/weight-meter/src/mock.rs +++ b/weight-meter/src/mock.rs @@ -8,7 +8,6 @@ pub mod test_module { #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] - #[pallet::without_storage_info] pub struct Pallet(PhantomData); #[pallet::hooks]