difftreelog
Merge pull request #856 from UniqueNetwork/fix/remove-xcm-v1-minor-fix
in: master
Fix/remove xcm v1 minor fix
14 files changed
pallets/configuration/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/configuration/src/benchmarking.rs
+++ b/pallets/configuration/src/benchmarking.rs
@@ -20,7 +20,7 @@
use frame_benchmarking::benchmarks;
use frame_system::{EventRecord, RawOrigin};
use frame_support::{assert_ok, BoundedVec, traits::Currency};
-use xcm::v1::MultiLocation;
+use xcm::latest::MultiLocation;
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
pallets/configuration/src/lib.rsdiffbeforeafterboth--- a/pallets/configuration/src/lib.rs
+++ b/pallets/configuration/src/lib.rs
@@ -47,7 +47,7 @@
BoundedVec, log,
};
use frame_system::{pallet_prelude::OriginFor, ensure_root, Config as SystemConfig};
- use xcm::v1::MultiLocation;
+ use xcm::latest::MultiLocation;
pub use crate::weights::WeightInfo;
pub type BalanceOf<T> =
@@ -116,7 +116,7 @@
#[pallet::storage]
pub type XcmAllowedLocationsOverride<T: Config> = StorageValue<
- Value = BoundedVec<MultiLocation, T::MaxXcmAllowedLocations>,
+ Value = BoundedVec<xcm::v2::MultiLocation, T::MaxXcmAllowedLocations>,
QueryKind = OptionQuery,
>;
pallets/foreign-assets/src/lib.rsdiffbeforeafterboth--- a/pallets/foreign-assets/src/lib.rs
+++ b/pallets/foreign-assets/src/lib.rs
@@ -52,10 +52,10 @@
use sp_std::{boxed::Box, vec::Vec};
use up_data_structs::{CollectionId, TokenId, CreateCollectionData};
-// NOTE:v1::MultiLocation is used in storages, we would need to do migration if upgrade the
-// MultiLocation in the future.
+// NOTE: MultiLocation is used in storages, we will need to do migration if upgrade the
+// MultiLocation to the XCM v3.
use xcm::opaque::latest::{prelude::XcmError, Weight};
-use xcm::{v1::MultiLocation, VersionedMultiLocation};
+use xcm::{latest::MultiLocation, VersionedMultiLocation};
use xcm_executor::{traits::WeightTrader, Assets};
use pallet_common::erc::CrossAccountId;
@@ -250,7 +250,7 @@
#[pallet::storage]
#[pallet::getter(fn foreign_asset_locations)]
pub type ForeignAssetLocations<T: Config> =
- StorageMap<_, Twox64Concat, ForeignAssetId, MultiLocation, OptionQuery>;
+ StorageMap<_, Twox64Concat, ForeignAssetId, xcm::v2::MultiLocation, OptionQuery>;
/// The storages for CurrencyIds.
///
@@ -258,7 +258,7 @@
#[pallet::storage]
#[pallet::getter(fn location_to_currency_ids)]
pub type LocationToCurrencyIds<T: Config> =
- StorageMap<_, Twox64Concat, MultiLocation, ForeignAssetId, OptionQuery>;
+ StorageMap<_, Twox64Concat, xcm::v2::MultiLocation, ForeignAssetId, OptionQuery>;
/// The storages for AssetMetadatas.
///
runtime/common/config/orml.rsdiffbeforeafterboth--- a/runtime/common/config/orml.rs
+++ b/runtime/common/config/orml.rs
@@ -21,8 +21,7 @@
use frame_system::EnsureSigned;
use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key};
use sp_runtime::traits::Convert;
-use xcm::v1::{Junction::*, Junctions::*, MultiLocation, NetworkId};
-use xcm::latest::Weight;
+use xcm::latest::{Weight, Junction::*, Junctions::*, MultiLocation, NetworkId};
use xcm_builder::LocationInverter;
use xcm_executor::XcmExecutor;
use sp_std::{vec, vec::Vec};
runtime/common/config/xcm/foreignassets.rsdiffbeforeafterboth--- a/runtime/common/config/xcm/foreignassets.rs
+++ b/runtime/common/config/xcm/foreignassets.rs
@@ -19,8 +19,7 @@
parameter_types,
};
use sp_runtime::traits::Convert;
-use xcm::v1::{Junction::*, MultiLocation, Junctions::*};
-use xcm::latest::MultiAsset;
+use xcm::latest::{MultiAsset, Junction::*, MultiLocation, Junctions::*};
use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId};
use xcm_executor::traits::{Convert as ConvertXcm, JustTry, FilterAssetLocation};
use pallet_foreign_assets::{
runtime/common/config/xcm/mod.rsdiffbeforeafterboth--- a/runtime/common/config/xcm/mod.rs
+++ b/runtime/common/config/xcm/mod.rs
@@ -21,8 +21,7 @@
use frame_system::EnsureRoot;
use pallet_xcm::XcmPassthrough;
use polkadot_parachain::primitives::Sibling;
-use xcm::v1::{Junction::*, MultiLocation, NetworkId};
-use xcm::latest::{prelude::*, Weight};
+use xcm::latest::{prelude::*, Weight, MultiLocation};
use xcm_builder::{
AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, ParentAsSuperuser,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
@@ -32,7 +31,7 @@
use sp_std::{marker::PhantomData, vec::Vec};
use crate::{
Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, ParachainInfo, ParachainSystem, PolkadotXcm,
- XcmpQueue, xcm_barrier::Barrier,
+ XcmpQueue, xcm_barrier::Barrier, RelayNetwork,
};
use up_common::types::AccountId;
@@ -53,7 +52,6 @@
parameter_types! {
pub const RelayLocation: MultiLocation = MultiLocation::parent();
- pub const RelayNetwork: NetworkId = NetworkId::Polkadot;
pub RelayOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())));
runtime/common/config/xcm/nativeassets.rsdiffbeforeafterboth--- a/runtime/common/config/xcm/nativeassets.rs
+++ b/runtime/common/config/xcm/nativeassets.rs
@@ -19,11 +19,13 @@
weights::WeightToFeePolynomial,
};
use sp_runtime::traits::{CheckedConversion, Zero, Convert};
-use xcm::v1::{Junction::*, MultiLocation, Junctions::*};
use xcm::latest::{
AssetId::{Concrete},
Fungibility::Fungible as XcmFungible,
MultiAsset, Error as XcmError, Weight,
+ Junction::*,
+ MultiLocation,
+ Junctions::*,
};
use xcm_builder::{CurrencyAdapter, NativeAsset};
use xcm_executor::{
runtime/common/xcm.rsdiffbeforeafterboth--- a/runtime/common/xcm.rs
+++ b/runtime/common/xcm.rs
@@ -15,7 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
use sp_std::{vec::Vec, marker::PhantomData};
-use xcm::v1::MultiLocation;
+use xcm::latest::MultiLocation;
use frame_support::traits::Get;
pub struct OverridableAllowedLocations<T, L>(PhantomData<(T, L)>)
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -34,6 +34,8 @@
use up_common::types::*;
+use ::xcm::latest::NetworkId;
+
#[path = "../../common/mod.rs"]
mod runtime_common;
@@ -63,6 +65,7 @@
pub const Version: RuntimeVersion = VERSION;
pub const SS58Prefix: u16 = 42;
pub const ChainId: u64 = 8882;
+ pub const RelayNetwork: NetworkId = NetworkId::Kusama;
}
construct_runtime!();
runtime/opal/src/xcm_barrier.rsdiffbeforeafterboth--- a/runtime/opal/src/xcm_barrier.rs
+++ b/runtime/opal/src/xcm_barrier.rs
@@ -15,10 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
use frame_support::traits::Everything;
-use xcm::{
- latest::{Xcm, Weight},
- v1::MultiLocation,
-};
+use xcm::latest::{Xcm, Weight, MultiLocation};
use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};
use xcm_executor::traits::ShouldExecute;
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -34,6 +34,8 @@
use up_common::types::*;
+use ::xcm::latest::NetworkId;
+
#[path = "../../common/mod.rs"]
mod runtime_common;
@@ -64,6 +66,7 @@
parameter_types! {
pub const Version: RuntimeVersion = VERSION;
+ pub const RelayNetwork: NetworkId = NetworkId::Kusama;
}
#[cfg(feature = "become-sapphire")]
parameter_types! {
runtime/quartz/src/xcm_barrier.rsdiffbeforeafterboth--- a/runtime/quartz/src/xcm_barrier.rs
+++ b/runtime/quartz/src/xcm_barrier.rs
@@ -19,7 +19,7 @@
traits::{Get, Everything},
};
use sp_std::{vec, vec::Vec};
-use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
+use xcm::latest::{Junction::*, Junctions::*, MultiLocation};
use xcm_builder::{
AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
AllowTopLevelPaidExecutionFrom,
runtime/unique/src/lib.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728extern crate alloc;2930use frame_support::parameter_types;3132use sp_version::RuntimeVersion;33use sp_runtime::create_runtime_str;3435use up_common::types::*;3637#[path = "../../common/mod.rs"]38mod runtime_common;3940pub mod xcm_barrier;4142#[cfg(test)]43mod tests;4445pub use runtime_common::*;4647pub const RUNTIME_NAME: &str = "unique";48pub const TOKEN_SYMBOL: &str = "UNQ";4950/// This runtime version.51pub const VERSION: RuntimeVersion = RuntimeVersion {52 spec_name: create_runtime_str!(RUNTIME_NAME),53 impl_name: create_runtime_str!(RUNTIME_NAME),54 authoring_version: 1,55 spec_version: 936050,56 impl_version: 0,57 apis: RUNTIME_API_VERSIONS,58 transaction_version: 3,59 state_version: 0,60};6162parameter_types! {63 pub const Version: RuntimeVersion = VERSION;64 pub const SS58Prefix: u16 = 7391;65 pub const ChainId: u64 = 8880;66}6768construct_runtime!();6970impl_common_runtime_apis!();7172cumulus_pallet_parachain_system::register_validate_block!(73 Runtime = Runtime,74 BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,75 CheckInherents = CheckInherents,76);1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728extern crate alloc;2930use frame_support::parameter_types;3132use sp_version::RuntimeVersion;33use sp_runtime::create_runtime_str;3435use up_common::types::*;3637use ::xcm::latest::NetworkId;3839#[path = "../../common/mod.rs"]40mod runtime_common;4142pub mod xcm_barrier;4344#[cfg(test)]45mod tests;4647pub use runtime_common::*;4849pub const RUNTIME_NAME: &str = "unique";50pub const TOKEN_SYMBOL: &str = "UNQ";5152/// This runtime version.53pub const VERSION: RuntimeVersion = RuntimeVersion {54 spec_name: create_runtime_str!(RUNTIME_NAME),55 impl_name: create_runtime_str!(RUNTIME_NAME),56 authoring_version: 1,57 spec_version: 936050,58 impl_version: 0,59 apis: RUNTIME_API_VERSIONS,60 transaction_version: 3,61 state_version: 0,62};6364parameter_types! {65 pub const Version: RuntimeVersion = VERSION;66 pub const SS58Prefix: u16 = 7391;67 pub const ChainId: u64 = 8880;68 pub const RelayNetwork: NetworkId = NetworkId::Polkadot;69}7071construct_runtime!();7273impl_common_runtime_apis!();7475cumulus_pallet_parachain_system::register_validate_block!(76 Runtime = Runtime,77 BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,78 CheckInherents = CheckInherents,79);runtime/unique/src/xcm_barrier.rsdiffbeforeafterboth--- a/runtime/unique/src/xcm_barrier.rs
+++ b/runtime/unique/src/xcm_barrier.rs
@@ -19,7 +19,7 @@
traits::{Get, Everything},
};
use sp_std::{vec, vec::Vec};
-use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
+use xcm::latest::{Junction::*, Junctions::*, MultiLocation};
use xcm_builder::{
AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
AllowTopLevelPaidExecutionFrom,