git.delta.rocks / unique-network / refs/commits / 5db935735ab9

difftreelog

fix IsReserve

Daniel Shiposha2023-03-27parent: #1e19d54.patch.diff
in: master

6 files changed

modifiedCargo.lockdiffbeforeafterboth
5692 "orml-tokens",5692 "orml-tokens",
5693 "orml-traits",5693 "orml-traits",
5694 "orml-vesting",5694 "orml-vesting",
5695 "orml-xcm-support",
5695 "orml-xtokens",5696 "orml-xtokens",
5696 "pallet-app-promotion",5697 "pallet-app-promotion",
5697 "pallet-aura",5698 "pallet-aura",
9142 "orml-tokens",9143 "orml-tokens",
9143 "orml-traits",9144 "orml-traits",
9144 "orml-vesting",9145 "orml-vesting",
9146 "orml-xcm-support",
9145 "orml-xtokens",9147 "orml-xtokens",
9146 "pallet-app-promotion",9148 "pallet-app-promotion",
9147 "pallet-aura",9149 "pallet-aura",
13418 "orml-tokens",13420 "orml-tokens",
13419 "orml-traits",13421 "orml-traits",
13420 "orml-vesting",13422 "orml-vesting",
13423 "orml-xcm-support",
13421 "orml-xtokens",13424 "orml-xtokens",
13422 "pallet-app-promotion",13425 "pallet-app-promotion",
13423 "pallet-aura",13426 "pallet-aura",
modifiedCargo.tomldiffbeforeafterboth
--- 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"] }
modifiedruntime/common/config/xcm/foreignassets.rsdiffbeforeafterboth
--- 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 <http://www.gnu.org/licenses/>.
 
-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<MultiAsset, MultiLocation> 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<AbsoluteReserveProvider>;
 
 pub type Trader<T> = FreeForAll<
 	pallet_configuration::WeightToFee<T, Balance>,
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- 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 }
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- 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 }
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- 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 }