git.delta.rocks / unique-network / refs/commits / 32b5c84f040e

difftreelog

Merge pull request #856 from UniqueNetwork/fix/remove-xcm-v1-minor-fix

Yaroslav Bolyukin2023-01-25parents: #40455c4 #8a829ea.patch.diff
in: master
Fix/remove xcm v1 minor fix

14 files changed

modifiedpallets/configuration/src/benchmarking.rsdiffbeforeafterboth
20use frame_benchmarking::benchmarks;20use frame_benchmarking::benchmarks;
21use frame_system::{EventRecord, RawOrigin};21use frame_system::{EventRecord, RawOrigin};
22use frame_support::{assert_ok, BoundedVec, traits::Currency};22use frame_support::{assert_ok, BoundedVec, traits::Currency};
23use xcm::v1::MultiLocation;23use xcm::latest::MultiLocation;
2424
25fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {25fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
26 let events = frame_system::Pallet::<T>::events();26 let events = frame_system::Pallet::<T>::events();
modifiedpallets/configuration/src/lib.rsdiffbeforeafterboth
47 BoundedVec, log,47 BoundedVec, log,
48 };48 };
49 use frame_system::{pallet_prelude::OriginFor, ensure_root, Config as SystemConfig};49 use frame_system::{pallet_prelude::OriginFor, ensure_root, Config as SystemConfig};
50 use xcm::v1::MultiLocation;50 use xcm::latest::MultiLocation;
5151
52 pub use crate::weights::WeightInfo;52 pub use crate::weights::WeightInfo;
53 pub type BalanceOf<T> =53 pub type BalanceOf<T> =
116116
117 #[pallet::storage]117 #[pallet::storage]
118 pub type XcmAllowedLocationsOverride<T: Config> = StorageValue<118 pub type XcmAllowedLocationsOverride<T: Config> = StorageValue<
119 Value = BoundedVec<MultiLocation, T::MaxXcmAllowedLocations>,119 Value = BoundedVec<xcm::v2::MultiLocation, T::MaxXcmAllowedLocations>,
120 QueryKind = OptionQuery,120 QueryKind = OptionQuery,
121 >;121 >;
122122
modifiedpallets/foreign-assets/src/lib.rsdiffbeforeafterboth
52use sp_std::{boxed::Box, vec::Vec};52use sp_std::{boxed::Box, vec::Vec};
53use up_data_structs::{CollectionId, TokenId, CreateCollectionData};53use up_data_structs::{CollectionId, TokenId, CreateCollectionData};
5454
55// NOTE:v1::MultiLocation is used in storages, we would need to do migration if upgrade the55// NOTE: MultiLocation is used in storages, we will need to do migration if upgrade the
56// MultiLocation in the future.56// MultiLocation to the XCM v3.
57use xcm::opaque::latest::{prelude::XcmError, Weight};57use xcm::opaque::latest::{prelude::XcmError, Weight};
58use xcm::{v1::MultiLocation, VersionedMultiLocation};58use xcm::{latest::MultiLocation, VersionedMultiLocation};
59use xcm_executor::{traits::WeightTrader, Assets};59use xcm_executor::{traits::WeightTrader, Assets};
6060
61use pallet_common::erc::CrossAccountId;61use pallet_common::erc::CrossAccountId;
250 #[pallet::storage]250 #[pallet::storage]
251 #[pallet::getter(fn foreign_asset_locations)]251 #[pallet::getter(fn foreign_asset_locations)]
252 pub type ForeignAssetLocations<T: Config> =252 pub type ForeignAssetLocations<T: Config> =
253 StorageMap<_, Twox64Concat, ForeignAssetId, MultiLocation, OptionQuery>;253 StorageMap<_, Twox64Concat, ForeignAssetId, xcm::v2::MultiLocation, OptionQuery>;
254254
255 /// The storages for CurrencyIds.255 /// The storages for CurrencyIds.
256 ///256 ///
257 /// LocationToCurrencyIds: map MultiLocation => Option<ForeignAssetId>257 /// LocationToCurrencyIds: map MultiLocation => Option<ForeignAssetId>
258 #[pallet::storage]258 #[pallet::storage]
259 #[pallet::getter(fn location_to_currency_ids)]259 #[pallet::getter(fn location_to_currency_ids)]
260 pub type LocationToCurrencyIds<T: Config> =260 pub type LocationToCurrencyIds<T: Config> =
261 StorageMap<_, Twox64Concat, MultiLocation, ForeignAssetId, OptionQuery>;261 StorageMap<_, Twox64Concat, xcm::v2::MultiLocation, ForeignAssetId, OptionQuery>;
262262
263 /// The storages for AssetMetadatas.263 /// The storages for AssetMetadatas.
264 ///264 ///
modifiedruntime/common/config/orml.rsdiffbeforeafterboth
21use frame_system::EnsureSigned;21use frame_system::EnsureSigned;
22use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key};22use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key};
23use sp_runtime::traits::Convert;23use sp_runtime::traits::Convert;
24use xcm::v1::{Junction::*, Junctions::*, MultiLocation, NetworkId};24use xcm::latest::{Weight, Junction::*, Junctions::*, MultiLocation, NetworkId};
25use xcm::latest::Weight;
26use xcm_builder::LocationInverter;25use xcm_builder::LocationInverter;
27use xcm_executor::XcmExecutor;26use xcm_executor::XcmExecutor;
28use sp_std::{vec, vec::Vec};27use sp_std::{vec, vec::Vec};
modifiedruntime/common/config/xcm/foreignassets.rsdiffbeforeafterboth
19 parameter_types,19 parameter_types,
20};20};
21use sp_runtime::traits::Convert;21use sp_runtime::traits::Convert;
22use xcm::v1::{Junction::*, MultiLocation, Junctions::*};22use xcm::latest::{MultiAsset, Junction::*, MultiLocation, Junctions::*};
23use xcm::latest::MultiAsset;
24use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId};23use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId};
25use xcm_executor::traits::{Convert as ConvertXcm, JustTry, FilterAssetLocation};24use xcm_executor::traits::{Convert as ConvertXcm, JustTry, FilterAssetLocation};
26use pallet_foreign_assets::{25use pallet_foreign_assets::{
modifiedruntime/common/config/xcm/mod.rsdiffbeforeafterboth
21use frame_system::EnsureRoot;21use frame_system::EnsureRoot;
22use pallet_xcm::XcmPassthrough;22use pallet_xcm::XcmPassthrough;
23use polkadot_parachain::primitives::Sibling;23use polkadot_parachain::primitives::Sibling;
24use xcm::v1::{Junction::*, MultiLocation, NetworkId};
25use xcm::latest::{prelude::*, Weight};24use xcm::latest::{prelude::*, Weight, MultiLocation};
26use xcm_builder::{25use xcm_builder::{
27 AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, ParentAsSuperuser,26 AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, ParentAsSuperuser,
28 RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,27 RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
32use sp_std::{marker::PhantomData, vec::Vec};31use sp_std::{marker::PhantomData, vec::Vec};
33use crate::{32use crate::{
34 Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, ParachainInfo, ParachainSystem, PolkadotXcm,33 Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, ParachainInfo, ParachainSystem, PolkadotXcm,
35 XcmpQueue, xcm_barrier::Barrier,34 XcmpQueue, xcm_barrier::Barrier, RelayNetwork,
36};35};
3736
38use up_common::types::AccountId;37use up_common::types::AccountId;
5352
54parameter_types! {53parameter_types! {
55 pub const RelayLocation: MultiLocation = MultiLocation::parent();54 pub const RelayLocation: MultiLocation = MultiLocation::parent();
56 pub const RelayNetwork: NetworkId = NetworkId::Polkadot;
57 pub RelayOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();55 pub RelayOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
58 pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();56 pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
59 pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())));57 pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())));
modifiedruntime/common/config/xcm/nativeassets.rsdiffbeforeafterboth
19 weights::WeightToFeePolynomial,19 weights::WeightToFeePolynomial,
20};20};
21use sp_runtime::traits::{CheckedConversion, Zero, Convert};21use sp_runtime::traits::{CheckedConversion, Zero, Convert};
22use xcm::v1::{Junction::*, MultiLocation, Junctions::*};
23use xcm::latest::{22use xcm::latest::{
24 AssetId::{Concrete},23 AssetId::{Concrete},
25 Fungibility::Fungible as XcmFungible,24 Fungibility::Fungible as XcmFungible,
26 MultiAsset, Error as XcmError, Weight,25 MultiAsset, Error as XcmError, Weight,
26 Junction::*,
27 MultiLocation,
28 Junctions::*,
27};29};
28use xcm_builder::{CurrencyAdapter, NativeAsset};30use xcm_builder::{CurrencyAdapter, NativeAsset};
29use xcm_executor::{31use xcm_executor::{
modifiedruntime/common/xcm.rsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17use sp_std::{vec::Vec, marker::PhantomData};17use sp_std::{vec::Vec, marker::PhantomData};
18use xcm::v1::MultiLocation;18use xcm::latest::MultiLocation;
19use frame_support::traits::Get;19use frame_support::traits::Get;
2020
21pub struct OverridableAllowedLocations<T, L>(PhantomData<(T, L)>)21pub struct OverridableAllowedLocations<T, L>(PhantomData<(T, L)>)
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
3434
35use up_common::types::*;35use up_common::types::*;
36
37use ::xcm::latest::NetworkId;
3638
37#[path = "../../common/mod.rs"]39#[path = "../../common/mod.rs"]
38mod runtime_common;40mod runtime_common;
63 pub const Version: RuntimeVersion = VERSION;65 pub const Version: RuntimeVersion = VERSION;
64 pub const SS58Prefix: u16 = 42;66 pub const SS58Prefix: u16 = 42;
65 pub const ChainId: u64 = 8882;67 pub const ChainId: u64 = 8882;
68 pub const RelayNetwork: NetworkId = NetworkId::Kusama;
66}69}
6770
68construct_runtime!();71construct_runtime!();
modifiedruntime/opal/src/xcm_barrier.rsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17use frame_support::traits::Everything;17use frame_support::traits::Everything;
18use xcm::{18use xcm::latest::{Xcm, Weight, MultiLocation};
19 latest::{Xcm, Weight},
20 v1::MultiLocation,
21};
22use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};19use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};
23use xcm_executor::traits::ShouldExecute;20use xcm_executor::traits::ShouldExecute;
2421
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
3434
35use up_common::types::*;35use up_common::types::*;
36
37use ::xcm::latest::NetworkId;
3638
37#[path = "../../common/mod.rs"]39#[path = "../../common/mod.rs"]
38mod runtime_common;40mod runtime_common;
6466
65parameter_types! {67parameter_types! {
66 pub const Version: RuntimeVersion = VERSION;68 pub const Version: RuntimeVersion = VERSION;
69 pub const RelayNetwork: NetworkId = NetworkId::Kusama;
67}70}
68#[cfg(feature = "become-sapphire")]71#[cfg(feature = "become-sapphire")]
69parameter_types! {72parameter_types! {
modifiedruntime/quartz/src/xcm_barrier.rsdiffbeforeafterboth
19 traits::{Get, Everything},19 traits::{Get, Everything},
20};20};
21use sp_std::{vec, vec::Vec};21use sp_std::{vec, vec::Vec};
22use xcm::v1::{Junction::*, Junctions::*, MultiLocation};22use xcm::latest::{Junction::*, Junctions::*, MultiLocation};
23use xcm_builder::{23use xcm_builder::{
24 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,24 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
25 AllowTopLevelPaidExecutionFrom,25 AllowTopLevelPaidExecutionFrom,
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
3434
35use up_common::types::*;35use up_common::types::*;
36
37use ::xcm::latest::NetworkId;
3638
37#[path = "../../common/mod.rs"]39#[path = "../../common/mod.rs"]
38mod runtime_common;40mod runtime_common;
63 pub const Version: RuntimeVersion = VERSION;65 pub const Version: RuntimeVersion = VERSION;
64 pub const SS58Prefix: u16 = 7391;66 pub const SS58Prefix: u16 = 7391;
65 pub const ChainId: u64 = 8880;67 pub const ChainId: u64 = 8880;
68 pub const RelayNetwork: NetworkId = NetworkId::Polkadot;
66}69}
6770
68construct_runtime!();71construct_runtime!();
modifiedruntime/unique/src/xcm_barrier.rsdiffbeforeafterboth
19 traits::{Get, Everything},19 traits::{Get, Everything},
20};20};
21use sp_std::{vec, vec::Vec};21use sp_std::{vec, vec::Vec};
22use xcm::v1::{Junction::*, Junctions::*, MultiLocation};22use xcm::latest::{Junction::*, Junctions::*, MultiLocation};
23use xcm_builder::{23use xcm_builder::{
24 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,24 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
25 AllowTopLevelPaidExecutionFrom,25 AllowTopLevelPaidExecutionFrom,