From ee451b0947ab4c531fcd5b8e7b40da510cf820fd Mon Sep 17 00:00:00 2001 From: Xiliang Chen Date: Thu, 30 Jan 2025 13:56:58 +1300 Subject: [PATCH] Polkadot stable2412 (#1018) * stable2412 * remove workaround * fixes after update * fix * workaround --------- Co-authored-by: Valery Klachkov --- .github/workflows/coverage.yml | 3 +- .github/workflows/test.yml | 3 +- Cargo.dev.toml | 64 +++++++++---------- asset-registry/src/impls.rs | 8 +-- asset-registry/src/mock/mod.rs | 10 +-- asset-registry/src/mock/para.rs | 6 +- asset-registry/src/mock/relay.rs | 3 +- asset-registry/src/tests.rs | 23 +------ authority/src/lib.rs | 4 +- authority/src/tests.rs | 4 +- benchmarking/src/lib.rs | 6 +- currencies/src/mock.rs | 1 + gradually-update/Cargo.toml | 2 +- oracle/runtime-api/Cargo.toml | 2 +- parameters/Cargo.toml | 2 +- rewards/Cargo.toml | 2 +- tokens/Cargo.toml | 2 +- tokens/runtime-api/Cargo.toml | 2 +- tokens/src/mock.rs | 18 +++++- traits/src/asset_registry.rs | 2 +- traits/src/location.rs | 2 +- traits/src/multi_asset.rs | 2 +- traits/src/xcm_transfer.rs | 2 +- unknown-tokens/src/lib.rs | 2 +- utilities/Cargo.toml | 4 +- vesting/Cargo.toml | 2 +- vesting/src/mock.rs | 1 + xcm-mock-message-queue/src/lib.rs | 2 +- xcm-support/src/currency_adapter.rs | 2 +- xcm-support/src/lib.rs | 2 +- xcm/src/lib.rs | 2 +- xtokens/src/lib.rs | 2 +- xtokens/src/mock/para.rs | 3 +- xtokens/src/mock/para_relative_view.rs | 3 +- xtokens/src/mock/para_teleport.rs | 3 +- xtokens/src/mock/relay.rs | 3 +- xtokens/src/mock/teleport_currency_adapter.rs | 2 +- xtokens/src/tests.rs | 6 +- 38 files changed, 109 insertions(+), 103 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index babc0d4f7..fd737725e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -37,7 +37,8 @@ jobs: tar -zxvf cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz -C $HOME/.cargo/bin make Cargo.toml cargo update - cargo update -p xcm-procedural --precise 10.1.0 + cargo update parity-scale-codec@3.7.2 --precise 3.6.12 + cargo update parity-scale-codec-derive@3.7.2 --precise 3.6.12 cargo tarpaulin --verbose --no-fail-fast --workspace --timeout 300 --out Xml - name: Upload to codecov.io uses: codecov/codecov-action@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2659e4273..f54d41024 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,8 @@ jobs: - name: Update run: | cargo update - cargo update -p xcm-procedural --precise 10.1.0 + cargo update parity-scale-codec@3.7.2 --precise 3.6.12 + cargo update parity-scale-codec-derive@3.7.2 --precise 3.6.12 - name: Run clippy run: cargo clippy -- -D warnings - name: Check for Wasm diff --git a/Cargo.dev.toml b/Cargo.dev.toml index 0c7e48623..d2c5e286a 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -32,40 +32,40 @@ resolver = "2" split-debuginfo = "unpacked" [workspace.dependencies] -log = { version = "0.4.20", default-features = false } +log = { version = "0.4.25", default-features = false } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.189" } -parity-scale-codec = { version = "3.6.5", default-features = false, features = ["max-encoded-len"] } +serde = { version = "1.0.214" } +parity-scale-codec = { version = "3.6.12", default-features = false, features = ["max-encoded-len"] } -cumulus-pallet-xcm = { version = "0.17.0", default-features = false } -cumulus-primitives-core = { version = "0.16.0", default-features = false } -frame-benchmarking = { version = "38.0.0", default-features = false } -frame-support = { version = "38.0.0", default-features = false } -frame-system = { version = "38.0.0", default-features = false } -pallet-balances = { version = "39.0.0", default-features = false } -pallet-elections-phragmen = { version = "39.0.0", default-features = false } -pallet-message-queue = { version = "41.0.1", default-features = false } -pallet-preimage = { version = "38.0.0", default-features = false } -pallet-root-testing = { version = "14.0.0", default-features = false } -pallet-scheduler = { version = "39.0.0", default-features = false } -pallet-timestamp = { version = "37.0.0", default-features = false } -pallet-treasury = { version = "37.0.0", default-features = false } -pallet-xcm = { version = "17.0.0", default-features = false } -polkadot-parachain-primitives = { version = "14.0.0", default-features = false } -polkadot-runtime-common = { version = "17.0.0", default-features = false } -polkadot-runtime-parachains = { version = "17.0.1", default-features = false } -sp-api = { version = "34.0.0", default-features = false } -sp-application-crypto = { version = "38.0.0", default-features = false } +cumulus-pallet-xcm = { version = "0.18.0", default-features = false } +cumulus-primitives-core = { version = "0.17.0", default-features = false } +frame-benchmarking = { version = "39.0.0", default-features = false } +frame-support = { version = "39.0.0", default-features = false } +frame-system = { version = "39.1.0", default-features = false } +pallet-balances = { version = "40.0.0", default-features = false } +pallet-elections-phragmen = { version = "40.0.0", default-features = false } +pallet-message-queue = { version = "42.0.0", default-features = false } +pallet-preimage = { version = "39.0.0", default-features = false } +pallet-root-testing = { version = "15.0.0", default-features = false } +pallet-scheduler = { version = "40.0.0", default-features = false } +pallet-timestamp = { version = "38.0.0", default-features = false } +pallet-treasury = { version = "38.0.0", default-features = false } +pallet-xcm = { version = "18.0.0", default-features = false } +polkadot-parachain-primitives = { version = "15.0.0", default-features = false } +polkadot-runtime-common = { version = "18.0.0", default-features = false } +polkadot-runtime-parachains = { version = "18.0.1", default-features = false } +sp-api = { version = "35.0.0", default-features = false } +sp-application-crypto = { version = "39.0.0", default-features = false } sp-arithmetic = { version = "26.0.0", default-features = false } -sp-core = { version = "34.0.0", default-features = false } -sp-io = { version = "38.0.0", default-features = false } -sp-runtime = { version = "39.0.1", default-features = false } -sp-runtime-interface = { version = "28.0.0", default-features = false } -sp-staking = { version = "36.0.0", default-features = false } +sp-core = { version = "35.0.0", default-features = false } +sp-io = { version = "39.0.0", default-features = false } +sp-runtime = { version = "40.1.0", default-features = false } +sp-runtime-interface = { version = "29.0.0", default-features = false } +sp-staking = { version = "37.0.0", default-features = false } sp-std = { version = "14.0.0", default-features = false } -sp-storage = { version = "21.0.0", default-features = false } -xcm = { version = "14.2.0", package = "staging-xcm", default-features = false } -xcm-builder = { version = "17.0.1", package = "staging-xcm-builder", default-features = false } -xcm-executor = { version = "17.0.0", package = "staging-xcm-executor", default-features = false } +sp-storage = { version = "22.0.0", default-features = false } +xcm = { version = "15.0.1", package = "staging-xcm", default-features = false } +xcm-builder = { version = "18.0.0", package = "staging-xcm-builder", default-features = false } +xcm-executor = { version = "18.0.0", package = "staging-xcm-executor", default-features = false } -xcm-simulator = { version = "17.0.0" } +xcm-simulator = { version = "18.0.0" } diff --git a/asset-registry/src/impls.rs b/asset-registry/src/impls.rs index 2a33094e3..26e01f7a3 100644 --- a/asset-registry/src/impls.rs +++ b/asset-registry/src/impls.rs @@ -15,7 +15,7 @@ use sp_std::prelude::*; use xcm::VersionedLocation; use xcm::{ v3, - v4::{prelude::*, Weight as XcmWeight}, + v5::{prelude::*, Weight as XcmWeight}, }; use xcm_builder::TakeRevenue; use xcm_executor::{traits::WeightTrader, AssetsInHolding}; @@ -188,7 +188,7 @@ impl Inspect for Pallet { type StringLimit = T::StringLimit; fn asset_id(location: &Location) -> Option { - Pallet::::location_to_asset_id(v3::Location::try_from(location.clone()).ok()?) + Pallet::::location_to_asset_id(v3::Location::try_from(location.clone().into_versioned()).ok()?) } fn metadata(id: &Self::AssetId) -> Option> { @@ -198,11 +198,11 @@ impl Inspect for Pallet { fn metadata_by_location( location: &Location, ) -> Option> { - Pallet::::fetch_metadata_by_location(&v3::Location::try_from(location.clone()).ok()?) + Pallet::::fetch_metadata_by_location(&v3::Location::try_from(location.clone().into_versioned()).ok()?) } fn location(asset_id: &Self::AssetId) -> Result, DispatchError> { - Pallet::::location(asset_id).map(|l| l.and_then(|l| l.try_into().ok())) + Pallet::::location(asset_id).map(|l| l.and_then(|l| l.into_versioned().try_into().ok())) } } diff --git a/asset-registry/src/mock/mod.rs b/asset-registry/src/mock/mod.rs index 9d1da52fb..f18427c57 100644 --- a/asset-registry/src/mock/mod.rs +++ b/asset-registry/src/mock/mod.rs @@ -10,7 +10,7 @@ use sp_io::TestExternalities; use sp_runtime::{traits::Convert, AccountId32, BuildStorage}; use xcm::{ v3, - v4::{Asset, Location}, + v5::{Asset, Location}, }; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain, TestExt}; @@ -109,12 +109,12 @@ impl Convert> for CurrencyIdConvert { ), CurrencyId::RegisteredAsset(id) => AssetRegistry::location(&id).unwrap_or_default(), }; - loc.and_then(|l| l.try_into().ok()) + loc.and_then(|l| l.into_versioned().try_into().ok()) } } impl Convert> for CurrencyIdConvert { fn convert(l: Location) -> Option { - use xcm::v4::Junction::*; + use xcm::v5::Junction::*; let a: Vec = "A".into(); let a1: Vec = "A1".into(); @@ -147,14 +147,14 @@ impl Convert> for CurrencyIdConvert { _ => None, }; currency_id.or_else(|| { - let loc = v3::Location::try_from(l.clone()).ok()?; + let loc = v3::Location::try_from(l.into_versioned()).ok()?; AssetRegistry::location_to_asset_id(&loc).map(CurrencyId::RegisteredAsset) }) } } impl Convert> for CurrencyIdConvert { fn convert(a: Asset) -> Option { - use xcm::v4::prelude::*; + use xcm::v5::prelude::*; if let Asset { fun: Fungible(_), id: AssetId(id), diff --git a/asset-registry/src/mock/para.rs b/asset-registry/src/mock/para.rs index 2121a2153..5e54fbb20 100644 --- a/asset-registry/src/mock/para.rs +++ b/asset-registry/src/mock/para.rs @@ -23,7 +23,7 @@ use sp_runtime::{ traits::{AccountIdConversion, Convert, IdentityLookup}, AccountId32, }; -use xcm::v4::{prelude::*, Weight}; +use xcm::v5::{prelude::*, Weight}; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, @@ -55,6 +55,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = [u8; 8]; type MaxFreezes = (); + type DoneSlashHandler = (); } use orml_asset_registry::impls::ExistentialDeposits as AssetRegistryExistentialDeposits; @@ -193,7 +194,8 @@ pub type AssetRegistryWeightTrader = pub struct MyFixedConversionRateProvider; impl FixedConversionRateProvider for MyFixedConversionRateProvider { fn get_fee_per_second(location: &Location) -> Option { - let metadata = AssetRegistry::fetch_metadata_by_location(&location.clone().try_into().unwrap())?; + let metadata = + AssetRegistry::fetch_metadata_by_location(&location.clone().into_versioned().try_into().unwrap())?; Some(metadata.additional.fee_per_second) } } diff --git a/asset-registry/src/mock/relay.rs b/asset-registry/src/mock/relay.rs index c3f867111..9b2daf768 100644 --- a/asset-registry/src/mock/relay.rs +++ b/asset-registry/src/mock/relay.rs @@ -12,7 +12,7 @@ use polkadot_runtime_parachains::{ origin, shared, }; use sp_runtime::{traits::IdentityLookup, AccountId32}; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, FixedWeightBounds, FungibleAdapter, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32, @@ -45,6 +45,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = [u8; 8]; type MaxFreezes = (); + type DoneSlashHandler = (); } impl shared::Config for Runtime { diff --git a/asset-registry/src/tests.rs b/asset-registry/src/tests.rs index 4bd8f09c4..9c94a0d6e 100644 --- a/asset-registry/src/tests.rs +++ b/asset-registry/src/tests.rs @@ -17,16 +17,9 @@ use sp_runtime::{ traits::{AccountIdConversion, BadOrigin, Dispatchable}, AccountId32, }; -use xcm::{v3, v4::prelude::*, VersionedLocation}; +use xcm::{v3, v5::prelude::*, VersionedLocation}; use xcm_simulator::TestExt; -#[allow(deprecated)] -type OldLocation = xcm::v2::MultiLocation; -#[allow(deprecated)] -type OldJunctions = xcm::v2::Junctions; -#[allow(deprecated)] -type OldJunction = xcm::v2::Junction; - fn treasury_account() -> AccountId32 { TreasuryAccount::get() } @@ -585,20 +578,6 @@ fn test_asset_authority() { }); } -#[test] -fn test_v2_to_v3_incompatible_multilocation() { - // Assert that V2 and V3 Location both are encoded differently - - #[allow(deprecated)] - let old_location = OldLocation::new( - 0, - OldJunctions::X1(OldJunction::GeneralKey(vec![0].try_into().unwrap())), - ); - assert!( - old_location.encode() != Location::new(0, [Junction::from(BoundedVec::try_from(vec![0]).unwrap())]).encode() - ); -} - #[test] fn test_decode_bounded_vec() { TestNet::reset(); diff --git a/authority/src/lib.rs b/authority/src/lib.rs index d2ca9bc28..b31ee2fc1 100644 --- a/authority/src/lib.rs +++ b/authority/src/lib.rs @@ -319,7 +319,7 @@ pub mod module { #[pallet::call_index(0)] #[pallet::weight({ let info = call.get_dispatch_info(); - (T::WeightInfo::dispatch_as().saturating_add(info.weight), info.class) + (T::WeightInfo::dispatch_as().saturating_add(info.total_weight()), info.class) })] pub fn dispatch_as(origin: OriginFor, as_origin: T::AsOriginId, call: Box>) -> DispatchResult { as_origin.check_dispatch_from(origin)?; @@ -508,7 +508,7 @@ pub mod module { ensure!(who == caller, Error::::TriggerCallNotPermitted); } ensure!( - call_weight_bound.all_gte(call.get_dispatch_info().weight), + call_weight_bound.all_gte(call.get_dispatch_info().total_weight()), Error::::WrongCallWeightBound ); let result = call.dispatch(OriginFor::::root()); diff --git a/authority/src/tests.rs b/authority/src/tests.rs index c1366c096..55b513eeb 100644 --- a/authority/src/tests.rs +++ b/authority/src/tests.rs @@ -491,7 +491,7 @@ fn trigger_call_works() { }); let hash = ::Hashing::hash_of(&call); - let call_weight_bound = call.get_dispatch_info().weight; + let call_weight_bound = call.get_dispatch_info().total_weight(); // call not authorized yet assert_noop!( @@ -617,7 +617,7 @@ fn trigger_call_should_be_free_and_operational() { ratio: Perbill::from_percent(50), }); let hash = ::Hashing::hash_of(&call); - let call_weight_bound = call.get_dispatch_info().weight; + let call_weight_bound = call.get_dispatch_info().total_weight(); let trigger_call = RuntimeCall::Authority(authority::Call::trigger_call { hash, call_weight_bound, diff --git a/benchmarking/src/lib.rs b/benchmarking/src/lib.rs index 2942d683e..d69559391 100644 --- a/benchmarking/src/lib.rs +++ b/benchmarking/src/lib.rs @@ -13,6 +13,8 @@ pub use frame_benchmarking::{ #[cfg(not(feature = "std"))] extern crate alloc; +#[cfg(not(feature = "std"))] +use alloc::{format, string::String}; #[cfg(feature = "std")] pub use frame_benchmarking::{Analysis, BenchmarkSelector}; #[doc(hidden)] @@ -1211,8 +1213,8 @@ pub fn show_benchmark_debug_info( components: &[(BenchmarkParameter, u32)], verify: &bool, error_message: &str, -) -> sp_runtime::RuntimeString { - sp_runtime::format_runtime_string!( +) -> String { + format!( "\n* Pallet: {}\n\ * Benchmark: {}\n\ * Components: {:?}\n\ diff --git a/currencies/src/mock.rs b/currencies/src/mock.rs index e00f1b4d0..b719650a1 100644 --- a/currencies/src/mock.rs +++ b/currencies/src/mock.rs @@ -46,6 +46,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = [u8; 8]; type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_type_with_key! { diff --git a/gradually-update/Cargo.toml b/gradually-update/Cargo.toml index c30015f46..f7b4807e4 100644 --- a/gradually-update/Cargo.toml +++ b/gradually-update/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Laminar Developers "] edition = "2021" [dependencies] -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] } +parity-scale-codec = { workspace = true, default-features = false, features = ["max-encoded-len"] } scale-info = { workspace = true } serde = { workspace = true, optional = true } diff --git a/oracle/runtime-api/Cargo.toml b/oracle/runtime-api/Cargo.toml index 195e16949..94697d8bd 100644 --- a/oracle/runtime-api/Cargo.toml +++ b/oracle/runtime-api/Cargo.toml @@ -8,7 +8,7 @@ description = "Runtime API module for orml-oracle." repository = "https://github.com/open-web3-stack/open-runtime-module-library" [dependencies] -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] } +parity-scale-codec = { workspace = true, default-features = false, features = ["derive"] } sp-api = { workspace = true } sp-std = { workspace = true } diff --git a/parameters/Cargo.toml b/parameters/Cargo.toml index b20ea2363..f3c5507f9 100644 --- a/parameters/Cargo.toml +++ b/parameters/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Acala Developers"] edition = "2021" [dependencies] -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] } +parity-scale-codec = { workspace = true, default-features = false, features = ["max-encoded-len"] } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } serde = { workspace = true, optional = true } diff --git a/rewards/Cargo.toml b/rewards/Cargo.toml index 530795324..d25b95887 100644 --- a/rewards/Cargo.toml +++ b/rewards/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Acala Developers"] edition = "2021" [dependencies] -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] } +parity-scale-codec = { workspace = true, default-features = false, features = ["max-encoded-len"] } scale-info = { workspace = true } serde = { workspace = true, optional = true } diff --git a/tokens/Cargo.toml b/tokens/Cargo.toml index 61461c4c8..d1e2049c6 100644 --- a/tokens/Cargo.toml +++ b/tokens/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Laminar Developers "] edition = "2021" [dependencies] -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] } +parity-scale-codec = { workspace = true, default-features = false, features = ["max-encoded-len"] } log = { workspace = true } scale-info = { workspace = true } serde = { workspace = true, optional = true } diff --git a/tokens/runtime-api/Cargo.toml b/tokens/runtime-api/Cargo.toml index 45cf5d137..716794790 100644 --- a/tokens/runtime-api/Cargo.toml +++ b/tokens/runtime-api/Cargo.toml @@ -8,7 +8,7 @@ description = "Runtime API module for orml-tokens." repository = "https://github.com/open-web3-stack/open-runtime-module-library" [dependencies] -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] } +parity-scale-codec = { workspace = true, default-features = false, features = ["derive"] } frame-support = { workspace = true } sp-api = { workspace = true } sp-runtime = { workspace = true } diff --git a/tokens/src/mock.rs b/tokens/src/mock.rs index 56ee19b78..956c591e6 100644 --- a/tokens/src/mock.rs +++ b/tokens/src/mock.rs @@ -7,13 +7,13 @@ use frame_support::{ construct_runtime, derive_impl, parameter_types, traits::{ tokens::{PayFromAccount, UnityAssetBalanceConversion}, - ChangeMembers, ConstU32, ConstU64, ContainsLengthBound, SortedMembers, + ChangeMembers, ConstU32, ConstU64, }, PalletId, }; use orml_traits::parameter_type_with_key; use sp_runtime::{ - traits::{AccountIdConversion, IdentityLookup}, + traits::{AccountIdConversion, BlockNumberProvider, IdentityLookup}, AccountId32, BuildStorage, Permill, }; use sp_std::cell::RefCell; @@ -65,6 +65,19 @@ parameter_types! { } pub type MockCurrencyAdapter = CurrencyAdapter; + +parameter_types! { + pub static MockBlockNumberProvider: u64 = 0; +} + +impl BlockNumberProvider for MockBlockNumberProvider { + type BlockNumber = u64; + + fn current_block_number() -> BlockNumberFor { + Self::get() + } +} + impl pallet_treasury::Config for Runtime { type PalletId = TreasuryPalletId; type Currency = MockCurrencyAdapter; @@ -85,6 +98,7 @@ impl pallet_treasury::Config for Runtime { type PayoutPeriod = ConstU64<10>; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = (); + type BlockNumberProvider = MockBlockNumberProvider; } thread_local! { diff --git a/traits/src/asset_registry.rs b/traits/src/asset_registry.rs index 903838cea..0ccdbc899 100644 --- a/traits/src/asset_registry.rs +++ b/traits/src/asset_registry.rs @@ -1,7 +1,7 @@ use frame_support::pallet_prelude::*; use sp_runtime::DispatchResult; use sp_std::fmt::Debug; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; use xcm::VersionedLocation; pub trait WeightToFeeConverter { diff --git a/traits/src/location.rs b/traits/src/location.rs index 761304424..cc1124b50 100644 --- a/traits/src/location.rs +++ b/traits/src/location.rs @@ -1,5 +1,5 @@ use sp_core::{bounded::BoundedVec, ConstU32}; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; pub trait Parse { /// Returns the "chain" location part. It could be parent, sibling diff --git a/traits/src/multi_asset.rs b/traits/src/multi_asset.rs index 1bb3217ad..f80088f36 100644 --- a/traits/src/multi_asset.rs +++ b/traits/src/multi_asset.rs @@ -1,5 +1,5 @@ use sp_core::{bounded::BoundedVec, ConstU32}; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; use crate::location::RelativeLocations; diff --git a/traits/src/xcm_transfer.rs b/traits/src/xcm_transfer.rs index bfc74c919..5a2ab80fb 100644 --- a/traits/src/xcm_transfer.rs +++ b/traits/src/xcm_transfer.rs @@ -1,7 +1,7 @@ use sp_runtime::DispatchError; use sp_std::vec::Vec; use xcm::{ - v4::{prelude::*, Weight}, + v5::{prelude::*, Weight}, VersionedAsset, VersionedAssets, VersionedLocation, }; pub struct Transferred { diff --git a/unknown-tokens/src/lib.rs b/unknown-tokens/src/lib.rs index abe0eebaf..c5e9bd749 100644 --- a/unknown-tokens/src/lib.rs +++ b/unknown-tokens/src/lib.rs @@ -3,7 +3,7 @@ use frame_support::pallet_prelude::*; use sp_std::vec::Vec; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; use orml_xcm_support::UnknownAsset; diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index 4f95d8370..ec4e71291 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -9,8 +9,8 @@ edition = "2021" [dependencies] scale-info = { workspace = true } -serde = { version = "1.0.136", optional = true, features = ["derive"] } -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] } +serde = { workspace = true, optional = true, features = ["derive"] } +parity-scale-codec = { workspace = true, default-features = false, features = ["derive"] } frame-support = { workspace = true } sp-runtime = { workspace = true, features = ["serde"] } diff --git a/vesting/Cargo.toml b/vesting/Cargo.toml index 0c05c30d8..fda12ce9e 100644 --- a/vesting/Cargo.toml +++ b/vesting/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Laminar Developers "] edition = "2021" [dependencies] -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] } +parity-scale-codec = { workspace = true, default-features = false, features = ["max-encoded-len"] } scale-info = { workspace = true } serde = { workspace = true, optional = true } diff --git a/vesting/src/mock.rs b/vesting/src/mock.rs index 5e0af38f9..61064ab6f 100644 --- a/vesting/src/mock.rs +++ b/vesting/src/mock.rs @@ -38,6 +38,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = [u8; 8]; type MaxFreezes = (); + type DoneSlashHandler = (); } pub struct EnsureAliceOrBob; diff --git a/xcm-mock-message-queue/src/lib.rs b/xcm-mock-message-queue/src/lib.rs index 367016ffc..9ee53eaaa 100644 --- a/xcm-mock-message-queue/src/lib.rs +++ b/xcm-mock-message-queue/src/lib.rs @@ -8,7 +8,7 @@ use parity_scale_codec::{Decode, Encode}; use polkadot_parachain_primitives::primitives::DmpMessageHandler; use sp_std::prelude::*; use xcm::{ - v4::{prelude::*, Weight}, + v5::{prelude::*, Weight}, VersionedXcm, }; diff --git a/xcm-support/src/currency_adapter.rs b/xcm-support/src/currency_adapter.rs index 01c95ef6a..7a00cf72c 100644 --- a/xcm-support/src/currency_adapter.rs +++ b/xcm-support/src/currency_adapter.rs @@ -12,7 +12,7 @@ use sp_std::{ result, }; -use xcm::v4::{prelude::*, Asset, Error as XcmError, Location, Result}; +use xcm::v5::{prelude::*, Asset, Error as XcmError, Location, Result}; use xcm_executor::{ traits::{ConvertLocation, MatchesFungible, TransactAsset}, AssetsInHolding, diff --git a/xcm-support/src/lib.rs b/xcm-support/src/lib.rs index 19af03909..252c733be 100644 --- a/xcm-support/src/lib.rs +++ b/xcm-support/src/lib.rs @@ -16,7 +16,7 @@ use sp_runtime::{ }; use sp_std::marker::PhantomData; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; use xcm_executor::traits::MatchesFungible; use orml_traits::{location::Reserve, GetByKey}; diff --git a/xcm/src/lib.rs b/xcm/src/lib.rs index ee510a0a6..d6ac66f40 100644 --- a/xcm/src/lib.rs +++ b/xcm/src/lib.rs @@ -6,7 +6,7 @@ use frame_support::{pallet_prelude::*, traits::EnsureOrigin}; use frame_system::pallet_prelude::*; use sp_std::boxed::Box; -use xcm::{v4::prelude::*, VersionedLocation, VersionedXcm}; +use xcm::{v5::prelude::*, VersionedLocation, VersionedXcm}; pub use module::*; diff --git a/xtokens/src/lib.rs b/xtokens/src/lib.rs index 17634956f..877fb7277 100644 --- a/xtokens/src/lib.rs +++ b/xtokens/src/lib.rs @@ -46,7 +46,7 @@ use sp_runtime::{ use sp_std::{prelude::*, result::Result}; use xcm::{ - v4::{prelude::*, Weight}, + v5::{prelude::*, Weight}, VersionedAsset, VersionedAssets, VersionedLocation, }; use xcm_executor::traits::WeightBounds; diff --git a/xtokens/src/mock/para.rs b/xtokens/src/mock/para.rs index 2df1f7b83..e467eca28 100644 --- a/xtokens/src/mock/para.rs +++ b/xtokens/src/mock/para.rs @@ -17,7 +17,7 @@ use sp_runtime::{ AccountId32, }; use sp_std::{cell::RefCell, marker::PhantomData}; -use xcm::v4::{prelude::*, Weight}; +use xcm::v5::{prelude::*, Weight}; use xcm_builder::{ AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, NativeAsset, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, @@ -56,6 +56,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = [u8; 8]; type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_type_with_key! { diff --git a/xtokens/src/mock/para_relative_view.rs b/xtokens/src/mock/para_relative_view.rs index edc7f0bac..6c2ed8d54 100644 --- a/xtokens/src/mock/para_relative_view.rs +++ b/xtokens/src/mock/para_relative_view.rs @@ -13,7 +13,7 @@ use sp_runtime::{ AccountId32, BoundedVec, }; use sp_std::marker::PhantomData; -use xcm::v4::{prelude::*, Weight}; +use xcm::v5::{prelude::*, Weight}; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, @@ -52,6 +52,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = [u8; 8]; type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_type_with_key! { diff --git a/xtokens/src/mock/para_teleport.rs b/xtokens/src/mock/para_teleport.rs index c0a8664f4..1dfac0acb 100644 --- a/xtokens/src/mock/para_teleport.rs +++ b/xtokens/src/mock/para_teleport.rs @@ -12,7 +12,7 @@ use sp_runtime::{ traits::{Convert, IdentityLookup}, AccountId32, }; -use xcm::v4::{prelude::*, Weight}; +use xcm::v5::{prelude::*, Weight}; use xcm_builder::{ AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, NativeAsset, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, @@ -49,6 +49,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = [u8; 8]; type MaxFreezes = (); + type DoneSlashHandler = (); } parameter_type_with_key! { diff --git a/xtokens/src/mock/relay.rs b/xtokens/src/mock/relay.rs index 47deaae4d..c3068fc41 100644 --- a/xtokens/src/mock/relay.rs +++ b/xtokens/src/mock/relay.rs @@ -13,7 +13,7 @@ use polkadot_runtime_parachains::{ inclusion::{AggregateMessageOrigin, UmpQueueId}, origin, shared, }; -use xcm::v4::prelude::*; +use xcm::v5::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, FixedWeightBounds, FungibleAdapter, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32, @@ -46,6 +46,7 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = [u8; 8]; type MaxFreezes = (); + type DoneSlashHandler = (); } impl shared::Config for Runtime { diff --git a/xtokens/src/mock/teleport_currency_adapter.rs b/xtokens/src/mock/teleport_currency_adapter.rs index 8a2a4030c..cebde1f8c 100644 --- a/xtokens/src/mock/teleport_currency_adapter.rs +++ b/xtokens/src/mock/teleport_currency_adapter.rs @@ -10,7 +10,7 @@ use sp_std::{ }; use orml_xcm_support::{OnDepositFail, UnknownAsset as UnknownAssetT}; -use xcm::v4::{prelude::*, Asset, Error as XcmError, Location, Result}; +use xcm::v5::{prelude::*, Asset, Error as XcmError, Location, Result}; use xcm_executor::{ traits::{ConvertLocation, MatchesFungible, TransactAsset}, AssetsInHolding, diff --git a/xtokens/src/tests.rs b/xtokens/src/tests.rs index 5f2e08b15..979730ca1 100644 --- a/xtokens/src/tests.rs +++ b/xtokens/src/tests.rs @@ -8,7 +8,7 @@ use orml_traits::{ConcreteFungibleAsset, MultiCurrency}; use parity_scale_codec::Encode; use polkadot_parachain_primitives::primitives::Sibling; use sp_runtime::{traits::AccountIdConversion, AccountId32}; -use xcm::{v4::OriginKind::SovereignAccount, VersionedXcm}; +use xcm::{v5::OriginKind::SovereignAccount, VersionedXcm}; use xcm_simulator::TestExt; fn para_a_account() -> AccountId32 { @@ -1038,7 +1038,7 @@ fn send_as_sovereign() { }, Instruction::Transact { origin_kind: SovereignAccount, - require_weight_at_most: 1_000_000_000.into(), + fallback_max_weight: Some(1_000_000_000.into()), call: call.encode().into(), } ]))) @@ -1080,7 +1080,7 @@ fn send_as_sovereign_fails_if_bad_origin() { }, Instruction::Transact { origin_kind: SovereignAccount, - require_weight_at_most: 1_000_000_000.into(), + fallback_max_weight: Some(1_000_000_000.into()), call: call.encode().into(), } ])))