diff --git a/modules/auction-manager/src/lib.rs b/modules/auction-manager/src/lib.rs index 3320eeac4..a5f491413 100644 --- a/modules/auction-manager/src/lib.rs +++ b/modules/auction-manager/src/lib.rs @@ -30,6 +30,7 @@ #![allow(clippy::upper_case_acronyms)] #![allow(clippy::unnecessary_unwrap)] +use codec::MaxEncodedLen; use frame_support::{log, pallet_prelude::*, transactional}; use frame_system::{ offchain::{SendTransactionTypes, SubmitTransaction}, @@ -69,7 +70,7 @@ pub const DEFAULT_MAX_ITERATIONS: u32 = 1000; /// Information of an collateral auction #[cfg_attr(feature = "std", derive(PartialEq, Eq))] -#[derive(Encode, Decode, Clone, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct CollateralAuctionItem { /// Refund recipient for may receive refund refund_recipient: AccountId, @@ -254,7 +255,6 @@ pub mod module { pub type TotalTargetInAuction = StorageValue<_, Balance, ValueQuery>; #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/cdp-engine/src/lib.rs b/modules/cdp-engine/src/lib.rs index 27388476b..f04ef4d01 100644 --- a/modules/cdp-engine/src/lib.rs +++ b/modules/cdp-engine/src/lib.rs @@ -28,6 +28,7 @@ #![allow(clippy::unused_unit)] #![allow(clippy::upper_case_acronyms)] +use codec::MaxEncodedLen; use frame_support::{log, pallet_prelude::*, traits::UnixTime, transactional}; use frame_system::{ offchain::{SendTransactionTypes, SubmitTransaction}, @@ -76,7 +77,7 @@ pub const DEFAULT_MAX_ITERATIONS: u32 = 1000; pub type LoansOf = loans::Pallet; /// Risk management params -#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, Default, TypeInfo)] +#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, Default, TypeInfo, MaxEncodedLen)] pub struct RiskManagementParams { /// Maximum total debit value generated from it, when reach the hard /// cap, CDP's owner cannot issue more stablecoin under the collateral @@ -354,7 +355,6 @@ pub mod module { } #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/cdp-treasury/src/lib.rs b/modules/cdp-treasury/src/lib.rs index 0aacd6e40..dfcca2c8a 100644 --- a/modules/cdp-treasury/src/lib.rs +++ b/modules/cdp-treasury/src/lib.rs @@ -165,7 +165,6 @@ pub mod module { } #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/dex/src/lib.rs b/modules/dex/src/lib.rs index df27f9c4d..7faae4ded 100644 --- a/modules/dex/src/lib.rs +++ b/modules/dex/src/lib.rs @@ -344,7 +344,6 @@ pub mod module { } #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/example/src/lib.rs b/modules/example/src/lib.rs index 061baa434..3b7a3dccc 100644 --- a/modules/example/src/lib.rs +++ b/modules/example/src/lib.rs @@ -24,6 +24,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![allow(clippy::unused_unit)] +use codec::MaxEncodedLen; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; @@ -38,7 +39,13 @@ pub mod module { #[pallet::config] pub trait Config: frame_system::Config { - type Balance: Parameter + codec::HasCompact + From + Into + Default + MaybeSerializeDeserialize; + type Balance: Parameter + + codec::HasCompact + + From + + Into + + Default + + MaybeSerializeDeserialize + + MaxEncodedLen; #[pallet::constant] type SomeConst: Get; type Event: From> + IsType<::Event>; @@ -108,7 +115,6 @@ pub mod module { } #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/homa-validator-list/src/lib.rs b/modules/homa-validator-list/src/lib.rs index c7a5da6f5..899036ea0 100644 --- a/modules/homa-validator-list/src/lib.rs +++ b/modules/homa-validator-list/src/lib.rs @@ -169,7 +169,14 @@ pub mod module { /// The overarching event type. type Event: From> + IsType<::Event>; /// The AccountId of a relay chain account. - type RelaychainAccountId: Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + Ord + Default; + type RelaychainAccountId: Parameter + + Member + + MaybeSerializeDeserialize + + Debug + + MaybeDisplay + + Ord + + Default + + MaxEncodedLen; /// The liquid representation of the staking token on the relay chain. type LiquidTokenCurrency: BasicLockableCurrency; #[pallet::constant] @@ -268,7 +275,6 @@ pub mod module { StorageMap<_, Blake2_128Concat, T::RelaychainAccountId, ValidatorBacking, OptionQuery>; #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/honzon-bridge/src/lib.rs b/modules/honzon-bridge/src/lib.rs index a61bea34f..504e9bbb4 100644 --- a/modules/honzon-bridge/src/lib.rs +++ b/modules/honzon-bridge/src/lib.rs @@ -74,7 +74,6 @@ pub mod module { } #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/honzon/src/lib.rs b/modules/honzon/src/lib.rs index 1c9e4c684..2c255a3df 100644 --- a/modules/honzon/src/lib.rs +++ b/modules/honzon/src/lib.rs @@ -118,7 +118,6 @@ pub mod module { >; #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/loans/src/lib.rs b/modules/loans/src/lib.rs index 94ba299f0..b4aa582d2 100644 --- a/modules/loans/src/lib.rs +++ b/modules/loans/src/lib.rs @@ -132,7 +132,6 @@ pub mod module { pub type TotalPositions = StorageMap<_, Twox64Concat, CurrencyId, Position, ValueQuery>; #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/prices/src/lib.rs b/modules/prices/src/lib.rs index 913953436..fdb00b9ca 100644 --- a/modules/prices/src/lib.rs +++ b/modules/prices/src/lib.rs @@ -138,7 +138,6 @@ pub mod module { pub type LockedPrice = StorageMap<_, Twox64Concat, CurrencyId, Price, OptionQuery>; #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/modules/transaction-payment/src/lib.rs b/modules/transaction-payment/src/lib.rs index aa2d40d36..d08075a21 100644 --- a/modules/transaction-payment/src/lib.rs +++ b/modules/transaction-payment/src/lib.rs @@ -460,7 +460,6 @@ pub mod module { pub type SwapBalanceThreshold = StorageMap<_, Twox64Concat, CurrencyId, Balance, ValueQuery>; #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 94ab8489f..d5ecd251f 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -125,7 +125,7 @@ pub enum DataProviderId { Acala = 1, } -#[derive(Encode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo)] +#[derive(Encode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct TradingPair(CurrencyId, CurrencyId);