Skip to content

Commit ee451b0

Browse files
xlcvklachkov
andauthored
Polkadot stable2412 (#1018)
* stable2412 * remove workaround * fixes after update * fix * workaround --------- Co-authored-by: Valery Klachkov <[email protected]>
1 parent 59e3734 commit ee451b0

File tree

38 files changed

+109
-103
lines changed

38 files changed

+109
-103
lines changed

.github/workflows/coverage.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737
tar -zxvf cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz -C $HOME/.cargo/bin
3838
make Cargo.toml
3939
cargo update
40-
cargo update -p xcm-procedural --precise 10.1.0
40+
cargo update [email protected] --precise 3.6.12
41+
cargo update [email protected] --precise 3.6.12
4142
cargo tarpaulin --verbose --no-fail-fast --workspace --timeout 300 --out Xml
4243
- name: Upload to codecov.io
4344
uses: codecov/codecov-action@v3

.github/workflows/test.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
- name: Update
3737
run: |
3838
cargo update
39-
cargo update -p xcm-procedural --precise 10.1.0
39+
cargo update [email protected] --precise 3.6.12
40+
cargo update [email protected] --precise 3.6.12
4041
- name: Run clippy
4142
run: cargo clippy -- -D warnings
4243
- name: Check for Wasm

Cargo.dev.toml

+32-32
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,40 @@ resolver = "2"
3232
split-debuginfo = "unpacked"
3333

3434
[workspace.dependencies]
35-
log = { version = "0.4.20", default-features = false }
35+
log = { version = "0.4.25", default-features = false }
3636
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
37-
serde = { version = "1.0.189" }
38-
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["max-encoded-len"] }
37+
serde = { version = "1.0.214" }
38+
parity-scale-codec = { version = "3.6.12", default-features = false, features = ["max-encoded-len"] }
3939

40-
cumulus-pallet-xcm = { version = "0.17.0", default-features = false }
41-
cumulus-primitives-core = { version = "0.16.0", default-features = false }
42-
frame-benchmarking = { version = "38.0.0", default-features = false }
43-
frame-support = { version = "38.0.0", default-features = false }
44-
frame-system = { version = "38.0.0", default-features = false }
45-
pallet-balances = { version = "39.0.0", default-features = false }
46-
pallet-elections-phragmen = { version = "39.0.0", default-features = false }
47-
pallet-message-queue = { version = "41.0.1", default-features = false }
48-
pallet-preimage = { version = "38.0.0", default-features = false }
49-
pallet-root-testing = { version = "14.0.0", default-features = false }
50-
pallet-scheduler = { version = "39.0.0", default-features = false }
51-
pallet-timestamp = { version = "37.0.0", default-features = false }
52-
pallet-treasury = { version = "37.0.0", default-features = false }
53-
pallet-xcm = { version = "17.0.0", default-features = false }
54-
polkadot-parachain-primitives = { version = "14.0.0", default-features = false }
55-
polkadot-runtime-common = { version = "17.0.0", default-features = false }
56-
polkadot-runtime-parachains = { version = "17.0.1", default-features = false }
57-
sp-api = { version = "34.0.0", default-features = false }
58-
sp-application-crypto = { version = "38.0.0", default-features = false }
40+
cumulus-pallet-xcm = { version = "0.18.0", default-features = false }
41+
cumulus-primitives-core = { version = "0.17.0", default-features = false }
42+
frame-benchmarking = { version = "39.0.0", default-features = false }
43+
frame-support = { version = "39.0.0", default-features = false }
44+
frame-system = { version = "39.1.0", default-features = false }
45+
pallet-balances = { version = "40.0.0", default-features = false }
46+
pallet-elections-phragmen = { version = "40.0.0", default-features = false }
47+
pallet-message-queue = { version = "42.0.0", default-features = false }
48+
pallet-preimage = { version = "39.0.0", default-features = false }
49+
pallet-root-testing = { version = "15.0.0", default-features = false }
50+
pallet-scheduler = { version = "40.0.0", default-features = false }
51+
pallet-timestamp = { version = "38.0.0", default-features = false }
52+
pallet-treasury = { version = "38.0.0", default-features = false }
53+
pallet-xcm = { version = "18.0.0", default-features = false }
54+
polkadot-parachain-primitives = { version = "15.0.0", default-features = false }
55+
polkadot-runtime-common = { version = "18.0.0", default-features = false }
56+
polkadot-runtime-parachains = { version = "18.0.1", default-features = false }
57+
sp-api = { version = "35.0.0", default-features = false }
58+
sp-application-crypto = { version = "39.0.0", default-features = false }
5959
sp-arithmetic = { version = "26.0.0", default-features = false }
60-
sp-core = { version = "34.0.0", default-features = false }
61-
sp-io = { version = "38.0.0", default-features = false }
62-
sp-runtime = { version = "39.0.1", default-features = false }
63-
sp-runtime-interface = { version = "28.0.0", default-features = false }
64-
sp-staking = { version = "36.0.0", default-features = false }
60+
sp-core = { version = "35.0.0", default-features = false }
61+
sp-io = { version = "39.0.0", default-features = false }
62+
sp-runtime = { version = "40.1.0", default-features = false }
63+
sp-runtime-interface = { version = "29.0.0", default-features = false }
64+
sp-staking = { version = "37.0.0", default-features = false }
6565
sp-std = { version = "14.0.0", default-features = false }
66-
sp-storage = { version = "21.0.0", default-features = false }
67-
xcm = { version = "14.2.0", package = "staging-xcm", default-features = false }
68-
xcm-builder = { version = "17.0.1", package = "staging-xcm-builder", default-features = false }
69-
xcm-executor = { version = "17.0.0", package = "staging-xcm-executor", default-features = false }
66+
sp-storage = { version = "22.0.0", default-features = false }
67+
xcm = { version = "15.0.1", package = "staging-xcm", default-features = false }
68+
xcm-builder = { version = "18.0.0", package = "staging-xcm-builder", default-features = false }
69+
xcm-executor = { version = "18.0.0", package = "staging-xcm-executor", default-features = false }
7070

71-
xcm-simulator = { version = "17.0.0" }
71+
xcm-simulator = { version = "18.0.0" }

asset-registry/src/impls.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use sp_std::prelude::*;
1515
use xcm::VersionedLocation;
1616
use xcm::{
1717
v3,
18-
v4::{prelude::*, Weight as XcmWeight},
18+
v5::{prelude::*, Weight as XcmWeight},
1919
};
2020
use xcm_builder::TakeRevenue;
2121
use xcm_executor::{traits::WeightTrader, AssetsInHolding};
@@ -188,7 +188,7 @@ impl<T: Config> Inspect for Pallet<T> {
188188
type StringLimit = T::StringLimit;
189189

190190
fn asset_id(location: &Location) -> Option<Self::AssetId> {
191-
Pallet::<T>::location_to_asset_id(v3::Location::try_from(location.clone()).ok()?)
191+
Pallet::<T>::location_to_asset_id(v3::Location::try_from(location.clone().into_versioned()).ok()?)
192192
}
193193

194194
fn metadata(id: &Self::AssetId) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata, Self::StringLimit>> {
@@ -198,11 +198,11 @@ impl<T: Config> Inspect for Pallet<T> {
198198
fn metadata_by_location(
199199
location: &Location,
200200
) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata, Self::StringLimit>> {
201-
Pallet::<T>::fetch_metadata_by_location(&v3::Location::try_from(location.clone()).ok()?)
201+
Pallet::<T>::fetch_metadata_by_location(&v3::Location::try_from(location.clone().into_versioned()).ok()?)
202202
}
203203

204204
fn location(asset_id: &Self::AssetId) -> Result<Option<Location>, DispatchError> {
205-
Pallet::<T>::location(asset_id).map(|l| l.and_then(|l| l.try_into().ok()))
205+
Pallet::<T>::location(asset_id).map(|l| l.and_then(|l| l.into_versioned().try_into().ok()))
206206
}
207207
}
208208

asset-registry/src/mock/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use sp_io::TestExternalities;
1010
use sp_runtime::{traits::Convert, AccountId32, BuildStorage};
1111
use xcm::{
1212
v3,
13-
v4::{Asset, Location},
13+
v5::{Asset, Location},
1414
};
1515
use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain, TestExt};
1616

@@ -109,12 +109,12 @@ impl Convert<CurrencyId, Option<Location>> for CurrencyIdConvert {
109109
),
110110
CurrencyId::RegisteredAsset(id) => AssetRegistry::location(&id).unwrap_or_default(),
111111
};
112-
loc.and_then(|l| l.try_into().ok())
112+
loc.and_then(|l| l.into_versioned().try_into().ok())
113113
}
114114
}
115115
impl Convert<Location, Option<CurrencyId>> for CurrencyIdConvert {
116116
fn convert(l: Location) -> Option<CurrencyId> {
117-
use xcm::v4::Junction::*;
117+
use xcm::v5::Junction::*;
118118

119119
let a: Vec<u8> = "A".into();
120120
let a1: Vec<u8> = "A1".into();
@@ -147,14 +147,14 @@ impl Convert<Location, Option<CurrencyId>> for CurrencyIdConvert {
147147
_ => None,
148148
};
149149
currency_id.or_else(|| {
150-
let loc = v3::Location::try_from(l.clone()).ok()?;
150+
let loc = v3::Location::try_from(l.into_versioned()).ok()?;
151151
AssetRegistry::location_to_asset_id(&loc).map(CurrencyId::RegisteredAsset)
152152
})
153153
}
154154
}
155155
impl Convert<Asset, Option<CurrencyId>> for CurrencyIdConvert {
156156
fn convert(a: Asset) -> Option<CurrencyId> {
157-
use xcm::v4::prelude::*;
157+
use xcm::v5::prelude::*;
158158
if let Asset {
159159
fun: Fungible(_),
160160
id: AssetId(id),

asset-registry/src/mock/para.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use sp_runtime::{
2323
traits::{AccountIdConversion, Convert, IdentityLookup},
2424
AccountId32,
2525
};
26-
use xcm::v4::{prelude::*, Weight};
26+
use xcm::v5::{prelude::*, Weight};
2727
use xcm_builder::{
2828
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, ParentIsPreset,
2929
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
@@ -55,6 +55,7 @@ impl pallet_balances::Config for Runtime {
5555
type RuntimeFreezeReason = RuntimeFreezeReason;
5656
type FreezeIdentifier = [u8; 8];
5757
type MaxFreezes = ();
58+
type DoneSlashHandler = ();
5859
}
5960

6061
use orml_asset_registry::impls::ExistentialDeposits as AssetRegistryExistentialDeposits;
@@ -193,7 +194,8 @@ pub type AssetRegistryWeightTrader =
193194
pub struct MyFixedConversionRateProvider;
194195
impl FixedConversionRateProvider for MyFixedConversionRateProvider {
195196
fn get_fee_per_second(location: &Location) -> Option<u128> {
196-
let metadata = AssetRegistry::fetch_metadata_by_location(&location.clone().try_into().unwrap())?;
197+
let metadata =
198+
AssetRegistry::fetch_metadata_by_location(&location.clone().into_versioned().try_into().unwrap())?;
197199
Some(metadata.additional.fee_per_second)
198200
}
199201
}

asset-registry/src/mock/relay.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use polkadot_runtime_parachains::{
1212
origin, shared,
1313
};
1414
use sp_runtime::{traits::IdentityLookup, AccountId32};
15-
use xcm::v4::prelude::*;
15+
use xcm::v5::prelude::*;
1616
use xcm_builder::{
1717
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia,
1818
FixedWeightBounds, FungibleAdapter, IsConcrete, SignedAccountId32AsNative, SignedToAccountId32,
@@ -45,6 +45,7 @@ impl pallet_balances::Config for Runtime {
4545
type RuntimeFreezeReason = RuntimeFreezeReason;
4646
type FreezeIdentifier = [u8; 8];
4747
type MaxFreezes = ();
48+
type DoneSlashHandler = ();
4849
}
4950

5051
impl shared::Config for Runtime {

asset-registry/src/tests.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,9 @@ use sp_runtime::{
1717
traits::{AccountIdConversion, BadOrigin, Dispatchable},
1818
AccountId32,
1919
};
20-
use xcm::{v3, v4::prelude::*, VersionedLocation};
20+
use xcm::{v3, v5::prelude::*, VersionedLocation};
2121
use xcm_simulator::TestExt;
2222

23-
#[allow(deprecated)]
24-
type OldLocation = xcm::v2::MultiLocation;
25-
#[allow(deprecated)]
26-
type OldJunctions = xcm::v2::Junctions;
27-
#[allow(deprecated)]
28-
type OldJunction = xcm::v2::Junction;
29-
3023
fn treasury_account() -> AccountId32 {
3124
TreasuryAccount::get()
3225
}
@@ -585,20 +578,6 @@ fn test_asset_authority() {
585578
});
586579
}
587580

588-
#[test]
589-
fn test_v2_to_v3_incompatible_multilocation() {
590-
// Assert that V2 and V3 Location both are encoded differently
591-
592-
#[allow(deprecated)]
593-
let old_location = OldLocation::new(
594-
0,
595-
OldJunctions::X1(OldJunction::GeneralKey(vec![0].try_into().unwrap())),
596-
);
597-
assert!(
598-
old_location.encode() != Location::new(0, [Junction::from(BoundedVec::try_from(vec![0]).unwrap())]).encode()
599-
);
600-
}
601-
602581
#[test]
603582
fn test_decode_bounded_vec() {
604583
TestNet::reset();

authority/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ pub mod module {
319319
#[pallet::call_index(0)]
320320
#[pallet::weight({
321321
let info = call.get_dispatch_info();
322-
(T::WeightInfo::dispatch_as().saturating_add(info.weight), info.class)
322+
(T::WeightInfo::dispatch_as().saturating_add(info.total_weight()), info.class)
323323
})]
324324
pub fn dispatch_as(origin: OriginFor<T>, as_origin: T::AsOriginId, call: Box<CallOf<T>>) -> DispatchResult {
325325
as_origin.check_dispatch_from(origin)?;
@@ -508,7 +508,7 @@ pub mod module {
508508
ensure!(who == caller, Error::<T>::TriggerCallNotPermitted);
509509
}
510510
ensure!(
511-
call_weight_bound.all_gte(call.get_dispatch_info().weight),
511+
call_weight_bound.all_gte(call.get_dispatch_info().total_weight()),
512512
Error::<T>::WrongCallWeightBound
513513
);
514514
let result = call.dispatch(OriginFor::<T>::root());

authority/src/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ fn trigger_call_works() {
491491
});
492492
let hash = <Runtime as frame_system::Config>::Hashing::hash_of(&call);
493493

494-
let call_weight_bound = call.get_dispatch_info().weight;
494+
let call_weight_bound = call.get_dispatch_info().total_weight();
495495

496496
// call not authorized yet
497497
assert_noop!(
@@ -617,7 +617,7 @@ fn trigger_call_should_be_free_and_operational() {
617617
ratio: Perbill::from_percent(50),
618618
});
619619
let hash = <Runtime as frame_system::Config>::Hashing::hash_of(&call);
620-
let call_weight_bound = call.get_dispatch_info().weight;
620+
let call_weight_bound = call.get_dispatch_info().total_weight();
621621
let trigger_call = RuntimeCall::Authority(authority::Call::trigger_call {
622622
hash,
623623
call_weight_bound,

benchmarking/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ pub use frame_benchmarking::{
1313

1414
#[cfg(not(feature = "std"))]
1515
extern crate alloc;
16+
#[cfg(not(feature = "std"))]
17+
use alloc::{format, string::String};
1618
#[cfg(feature = "std")]
1719
pub use frame_benchmarking::{Analysis, BenchmarkSelector};
1820
#[doc(hidden)]
@@ -1211,8 +1213,8 @@ pub fn show_benchmark_debug_info(
12111213
components: &[(BenchmarkParameter, u32)],
12121214
verify: &bool,
12131215
error_message: &str,
1214-
) -> sp_runtime::RuntimeString {
1215-
sp_runtime::format_runtime_string!(
1216+
) -> String {
1217+
format!(
12161218
"\n* Pallet: {}\n\
12171219
* Benchmark: {}\n\
12181220
* Components: {:?}\n\

currencies/src/mock.rs

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ impl pallet_balances::Config for Runtime {
4646
type RuntimeFreezeReason = RuntimeFreezeReason;
4747
type FreezeIdentifier = [u8; 8];
4848
type MaxFreezes = ();
49+
type DoneSlashHandler = ();
4950
}
5051

5152
parameter_type_with_key! {

gradually-update/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = ["Laminar Developers <[email protected]>"]
88
edition = "2021"
99

1010
[dependencies]
11-
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] }
11+
parity-scale-codec = { workspace = true, default-features = false, features = ["max-encoded-len"] }
1212
scale-info = { workspace = true }
1313
serde = { workspace = true, optional = true }
1414

oracle/runtime-api/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "Runtime API module for orml-oracle."
88
repository = "https://github.com/open-web3-stack/open-runtime-module-library"
99

1010
[dependencies]
11-
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] }
11+
parity-scale-codec = { workspace = true, default-features = false, features = ["derive"] }
1212
sp-api = { workspace = true }
1313
sp-std = { workspace = true }
1414

parameters/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = ["Acala Developers"]
88
edition = "2021"
99

1010
[dependencies]
11-
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] }
11+
parity-scale-codec = { workspace = true, default-features = false, features = ["max-encoded-len"] }
1212
scale-info = { version = "2.1.2", default-features = false, features = ["derive"] }
1313
serde = { workspace = true, optional = true }
1414

rewards/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = ["Acala Developers"]
88
edition = "2021"
99

1010
[dependencies]
11-
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] }
11+
parity-scale-codec = { workspace = true, default-features = false, features = ["max-encoded-len"] }
1212
scale-info = { workspace = true }
1313
serde = { workspace = true, optional = true }
1414

tokens/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = ["Laminar Developers <[email protected]>"]
88
edition = "2021"
99

1010
[dependencies]
11-
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] }
11+
parity-scale-codec = { workspace = true, default-features = false, features = ["max-encoded-len"] }
1212
log = { workspace = true }
1313
scale-info = { workspace = true }
1414
serde = { workspace = true, optional = true }

tokens/runtime-api/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "Runtime API module for orml-tokens."
88
repository = "https://github.com/open-web3-stack/open-runtime-module-library"
99

1010
[dependencies]
11-
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] }
11+
parity-scale-codec = { workspace = true, default-features = false, features = ["derive"] }
1212
frame-support = { workspace = true }
1313
sp-api = { workspace = true }
1414
sp-runtime = { workspace = true }

0 commit comments

Comments
 (0)