From 5db935735ab97f49dd440f60ed36e1eb1cbebdb8 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 27 Mar 2023 13:50:22 +0000 Subject: [PATCH] fix: IsReserve --- --- a/Cargo.lock +++ b/Cargo.lock @@ -5692,6 +5692,7 @@ "orml-tokens", "orml-traits", "orml-vesting", + "orml-xcm-support", "orml-xtokens", "pallet-app-promotion", "pallet-aura", @@ -9142,6 +9143,7 @@ "orml-tokens", "orml-traits", "orml-vesting", + "orml-xcm-support", "orml-xtokens", "pallet-app-promotion", "pallet-aura", @@ -13418,6 +13420,7 @@ "orml-tokens", "orml-traits", "orml-vesting", + "orml-xcm-support", "orml-xtokens", "pallet-app-promotion", "pallet-aura", --- a/Cargo.toml +++ b/Cargo.toml @@ -181,6 +181,7 @@ orml-traits = { default-features = false , git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } orml-vesting = { default-features = false , git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } orml-xtokens = { default-features = false , git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } +orml-xcm-support = { default-features = false , git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.39" } # Other derivative = { version = "2.2.0", features = ["use_core"] } --- a/runtime/common/config/xcm/foreignassets.rs +++ b/runtime/common/config/xcm/foreignassets.rs @@ -14,10 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{ - traits::{Get, ContainsPair}, - parameter_types, -}; +use frame_support::{traits::Get, parameter_types}; use sp_runtime::traits::Convert; use xcm::latest::{prelude::*, MultiAsset, MultiLocation}; use xcm_builder::{FungiblesAdapter, NoChecking, ConvertedConcreteId}; @@ -27,6 +24,8 @@ ForeignAssetId, CurrencyId, }; use sp_std::{borrow::Borrow, marker::PhantomData}; +use orml_traits::location::AbsoluteReserveProvider; +use orml_xcm_support::MultiNativeAsset; use crate::{Runtime, Balances, ParachainInfo, PolkadotXcm, ForeignAssets}; use super::{LocationToAccountId, RelayLocation}; @@ -169,16 +168,7 @@ } } -pub struct AllAsset; -impl ContainsPair for AllAsset { - fn contains(_asset: &MultiAsset, _origin: &MultiLocation) -> bool { - // ? Shouldn't we query foreign-asset pallet here, because of the new non-local mint - // location logic? - true - } -} - -pub type IsReserve = AllAsset; +pub type IsReserve = MultiNativeAsset; pub type Trader = FreeForAll< pallet_configuration::WeightToFee, --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -130,6 +130,7 @@ "orml-traits/std", "orml-vesting/std", "orml-xtokens/std", + "orml-xcm-support/std", "pallet-foreign-assets/std", 'pallet-maintenance/std', @@ -217,6 +218,7 @@ orml-traits = { workspace = true } orml-vesting = { workspace = true } orml-xtokens = { workspace = true } +orml-xcm-support = { workspace = true } pallet-aura = { workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -129,6 +129,7 @@ "orml-traits/std", "orml-vesting/std", "orml-xtokens/std", + "orml-xcm-support/std", "pallet-foreign-assets/std", "pallet-maintenance/std", ] @@ -209,6 +210,7 @@ orml-traits = { workspace = true } orml-vesting = { workspace = true } orml-xtokens = { workspace = true } +orml-xcm-support = { workspace = true } pallet-aura = { workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -126,6 +126,7 @@ "orml-traits/std", "orml-vesting/std", "orml-xtokens/std", + "orml-xcm-support/std", "pallet-foreign-assets/std", "pallet-maintenance/std", ] @@ -208,6 +209,7 @@ orml-traits = { workspace = true } orml-vesting = { workspace = true } orml-xtokens = { workspace = true } +orml-xcm-support = { workspace = true } pallet-aura = { workspace = true } pallet-authorship = { workspace = true } pallet-balances = { workspace = true } -- gitstuff