From f633379e28c2d7d3659ec48e7d8561050d6fbc8c Mon Sep 17 00:00:00 2001 From: zqh Date: Mon, 21 Mar 2022 14:42:23 +0800 Subject: [PATCH 1/5] add fiter with Everything --- orml | 2 +- runtime/acala/src/xcm_config.rs | 1 + runtime/karura/src/xcm_config.rs | 1 + runtime/mandala/src/xcm_config.rs | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/orml b/orml index 0a5a2df3b..fecbe0197 160000 --- a/orml +++ b/orml @@ -1 +1 @@ -Subproject commit 0a5a2df3b796f1fcfec3c4c32cc853716fa6c3da +Subproject commit fecbe0197ac0c1380424d193a46289d3846cbf1d diff --git a/runtime/acala/src/xcm_config.rs b/runtime/acala/src/xcm_config.rs index ee23d760b..b3d513e60 100644 --- a/runtime/acala/src/xcm_config.rs +++ b/runtime/acala/src/xcm_config.rs @@ -355,4 +355,5 @@ impl orml_xtokens::Config for Runtime { type LocationInverter = LocationInverter; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; } diff --git a/runtime/karura/src/xcm_config.rs b/runtime/karura/src/xcm_config.rs index dc7efcd93..9c973742b 100644 --- a/runtime/karura/src/xcm_config.rs +++ b/runtime/karura/src/xcm_config.rs @@ -328,6 +328,7 @@ impl orml_xtokens::Config for Runtime { type LocationInverter = LocationInverter; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; } pub type LocalAssetTransactor = MultiCurrencyAdapter< diff --git a/runtime/mandala/src/xcm_config.rs b/runtime/mandala/src/xcm_config.rs index 47f8aa329..ed0b31972 100644 --- a/runtime/mandala/src/xcm_config.rs +++ b/runtime/mandala/src/xcm_config.rs @@ -345,4 +345,5 @@ impl orml_xtokens::Config for Runtime { type LocationInverter = LocationInverter; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; } From 2050072e2a541c20b1ca80079af439a919a5ffa5 Mon Sep 17 00:00:00 2001 From: zqh Date: Mon, 21 Mar 2022 17:47:00 +0800 Subject: [PATCH 2/5] rm without storage info --- modules/auction-manager/src/lib.rs | 4 ++-- modules/cdp-engine/src/lib.rs | 4 ++-- modules/cdp-treasury/src/lib.rs | 1 - modules/dex/src/lib.rs | 1 - modules/example/src/lib.rs | 10 ++++++++-- modules/honzon/src/lib.rs | 1 - modules/loans/src/lib.rs | 1 - modules/prices/src/lib.rs | 1 - modules/transaction-payment/src/lib.rs | 1 - orml | 2 +- primitives/src/lib.rs | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/auction-manager/src/lib.rs b/modules/auction-manager/src/lib.rs index ed4577fc3..ec6e3cd72 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 1703396a2..0bb794a3d 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 01e8c4f1f..f074760a5 100644 --- a/modules/cdp-treasury/src/lib.rs +++ b/modules/cdp-treasury/src/lib.rs @@ -154,7 +154,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/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 e0dcbad26..59473e6ae 100644 --- a/modules/transaction-payment/src/lib.rs +++ b/modules/transaction-payment/src/lib.rs @@ -454,7 +454,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/orml b/orml index fecbe0197..85b18479b 160000 --- a/orml +++ b/orml @@ -1 +1 @@ -Subproject commit fecbe0197ac0c1380424d193a46289d3846cbf1d +Subproject commit 85b18479bec3bd8e1db1db0ca2cf0e6db1512086 diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index cc3ca4602..55f0a71ec 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -123,7 +123,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); From f436af0a6d9527f06a7ef02fe2620b4da2b7e611 Mon Sep 17 00:00:00 2001 From: zqh Date: Mon, 21 Mar 2022 18:00:01 +0800 Subject: [PATCH 3/5] add homa-validate-list --- modules/homa-validator-list/src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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] From a4ed7e9b73acf43cd39f0a466178e962a414e28f Mon Sep 17 00:00:00 2001 From: zqh Date: Fri, 25 Mar 2022 11:47:41 +0800 Subject: [PATCH 4/5] honzon bridge --- modules/honzon-bridge/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/honzon-bridge/src/lib.rs b/modules/honzon-bridge/src/lib.rs index a61bea34f..0bc9f2b6d 100644 --- a/modules/honzon-bridge/src/lib.rs +++ b/modules/honzon-bridge/src/lib.rs @@ -74,7 +74,7 @@ pub mod module { } #[pallet::pallet] - #[pallet::without_storage_info] + // #[pallet::without_storage_info] pub struct Pallet(_); #[pallet::hooks] From 4291d64374aa32db7a3c33a17453de3c094b09f2 Mon Sep 17 00:00:00 2001 From: zqh Date: Thu, 7 Apr 2022 12:23:01 +0800 Subject: [PATCH 5/5] rm useless code --- modules/honzon-bridge/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/honzon-bridge/src/lib.rs b/modules/honzon-bridge/src/lib.rs index 0bc9f2b6d..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]