Skip to content

Commit 44fda44

Browse files
authored
Upgrade to polkadot-v0.9.29 (#809)
1 parent 7e1123e commit 44fda44

File tree

54 files changed

+463
-461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+463
-461
lines changed

Cargo.dev.toml

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

asset-registry/Cargo.toml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,37 @@ serde = { version = "1.0.136", optional = true }
1313
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["max-encoded-len"] }
1414

1515
# substrate
16-
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
17-
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
18-
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
19-
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
16+
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
17+
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
18+
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
19+
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
2020

2121
# polkadot
22-
pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.28" }
23-
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.28" }
24-
xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.28" }
25-
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.28" }
22+
pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.29" }
23+
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.29" }
24+
xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.29" }
25+
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false , branch = "release-v0.9.29" }
2626

2727
# orml
2828
orml-traits = { path = "../traits", version = "0.4.1-dev", default-features = false }
2929

3030
[dev-dependencies]
3131
# substrate
32-
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
33-
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
34-
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
32+
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
33+
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
34+
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
3535

3636
# cumulus
37-
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.28" }
38-
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.28" }
39-
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.28" }
40-
cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.28" }
41-
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.28" }
37+
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" }
38+
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" }
39+
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" }
40+
cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" }
41+
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" }
4242

4343
# polkadot
44-
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.28" }
45-
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.28" }
46-
xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.28" }
44+
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
45+
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
46+
xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
4747

4848
# orml
4949
orml-tokens = { path = "../tokens" }

asset-registry/src/impls.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use sp_runtime::{
1212
ArithmeticError, FixedU128,
1313
};
1414
use sp_std::prelude::*;
15-
use xcm::latest::prelude::*;
15+
use xcm::latest::{prelude::*, Weight as XcmWeight};
1616
use xcm::VersionedMultiLocation;
1717
use xcm_builder::TakeRevenue;
1818
use xcm_executor::{traits::WeightTrader, Assets};
@@ -55,7 +55,7 @@ pub struct FixedRateAssetRegistryTrader<P: FixedConversionRateProvider>(PhantomD
5555
impl<P: FixedConversionRateProvider> WeightToFeeConverter for FixedRateAssetRegistryTrader<P> {
5656
fn convert_weight_to_fee(location: &MultiLocation, weight: Weight) -> Option<u128> {
5757
let fee_per_second = P::get_fee_per_second(location)?;
58-
let weight_ratio = FixedU128::saturating_from_rational(weight as u128, WEIGHT_PER_SECOND as u128);
58+
let weight_ratio = FixedU128::saturating_from_rational(weight.ref_time(), WEIGHT_PER_SECOND.ref_time() as u128);
5959
let amount = weight_ratio.saturating_mul_int(fee_per_second);
6060
Some(amount)
6161
}
@@ -89,7 +89,7 @@ impl<W: WeightToFeeConverter, R: TakeRevenue> WeightTrader for AssetRegistryTrad
8989
}
9090
}
9191

92-
fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result<Assets, XcmError> {
92+
fn buy_weight(&mut self, weight: XcmWeight, payment: Assets) -> Result<Assets, XcmError> {
9393
log::trace!(
9494
target: "xcm::weight",
9595
"AssetRegistryTrader::buy_weight weight: {:?}, payment: {:?}",
@@ -104,7 +104,7 @@ impl<W: WeightToFeeConverter, R: TakeRevenue> WeightTrader for AssetRegistryTrad
104104
continue;
105105
}
106106

107-
if let Some(fee_increase) = W::convert_weight_to_fee(location, weight) {
107+
if let Some(fee_increase) = W::convert_weight_to_fee(location, Weight::from_ref_time(weight)) {
108108
if fee_increase == 0 {
109109
// if the fee is set very low it could lead to zero fees, in which case
110110
// constructing the fee asset item to subtract from payment would fail.
@@ -115,12 +115,14 @@ impl<W: WeightToFeeConverter, R: TakeRevenue> WeightTrader for AssetRegistryTrad
115115
if let Ok(unused) = payment.clone().checked_sub((asset.clone(), fee_increase).into()) {
116116
let (existing_weight, existing_fee) = match self.bought_weight {
117117
Some(ref x) => (x.weight, x.amount),
118-
None => (0, 0),
118+
None => (Weight::zero(), 0),
119119
};
120120

121121
self.bought_weight = Some(BoughtWeight {
122122
amount: existing_fee.checked_add(fee_increase).ok_or(XcmError::Overflow)?,
123-
weight: existing_weight.checked_add(weight).ok_or(XcmError::Overflow)?,
123+
weight: existing_weight
124+
.checked_add(&Weight::from_ref_time(weight))
125+
.ok_or(XcmError::Overflow)?,
124126
asset_location: location.clone(),
125127
});
126128
return Ok(unused);
@@ -131,12 +133,12 @@ impl<W: WeightToFeeConverter, R: TakeRevenue> WeightTrader for AssetRegistryTrad
131133
Err(XcmError::TooExpensive)
132134
}
133135

134-
fn refund_weight(&mut self, weight: Weight) -> Option<MultiAsset> {
136+
fn refund_weight(&mut self, weight: XcmWeight) -> Option<MultiAsset> {
135137
log::trace!(target: "xcm::weight", "AssetRegistryTrader::refund_weight weight: {:?}", weight);
136138

137139
match self.bought_weight {
138140
Some(ref mut bought) => {
139-
let new_weight = bought.weight.saturating_sub(weight);
141+
let new_weight = bought.weight.saturating_sub(Weight::from_ref_time(weight));
140142
let new_amount = W::convert_weight_to_fee(&bought.asset_location, new_weight)?;
141143
let refunded_amount = bought.amount.saturating_sub(new_amount);
142144

asset-registry/src/mock/para.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use frame_support::traits::{EnsureOrigin, EnsureOriginWithArg};
88
use frame_support::{
99
construct_runtime, match_types, ord_parameter_types, parameter_types,
1010
traits::{ConstU128, ConstU32, ConstU64, Everything, Nothing},
11-
weights::{constants::WEIGHT_PER_SECOND, Weight},
11+
weights::constants::WEIGHT_PER_SECOND,
1212
PalletId,
1313
};
1414
use frame_system::{EnsureRoot, EnsureSignedBy};
@@ -26,7 +26,7 @@ use sp_runtime::{
2626
traits::{AccountIdConversion, Convert, IdentityLookup},
2727
AccountId32,
2828
};
29-
use xcm::latest::prelude::*;
29+
use xcm::latest::{prelude::*, Weight};
3030
use xcm_builder::{
3131
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, LocationInverter,
3232
ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
@@ -145,8 +145,8 @@ impl orml_asset_registry::Config for Runtime {
145145
}
146146

147147
parameter_types! {
148-
pub const ReservedXcmpWeight: Weight = WEIGHT_PER_SECOND / 4;
149-
pub const ReservedDmpWeight: Weight = WEIGHT_PER_SECOND / 4;
148+
pub const ReservedXcmpWeight: Weight = WEIGHT_PER_SECOND.ref_time() / 4;
149+
pub const ReservedDmpWeight: Weight = WEIGHT_PER_SECOND.ref_time() / 4;
150150
}
151151

152152
impl parachain_info::Config for Runtime {}

asset-registry/src/weights.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ pub trait WeightInfo {
1818
/// Default weights.
1919
impl WeightInfo for () {
2020
fn register_asset() -> Weight {
21-
0
21+
Weight::zero()
2222
}
2323
fn update_asset() -> Weight {
24-
0
24+
Weight::zero()
2525
}
2626
fn set_asset_location() -> Weight {
27-
0
27+
Weight::zero()
2828
}
2929
}

auction/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ scale-info = { version = "2.1.2", default-features = false, features = ["derive"
1212
serde = { version = "1.0.136", optional = true }
1313
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
1414

15-
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
16-
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
17-
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
18-
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
15+
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
16+
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
17+
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
18+
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
1919

2020
orml-traits = { path = "../traits", version = "0.4.1-dev", default-features = false }
2121

2222
[dev-dependencies]
23-
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
24-
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
23+
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
24+
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
2525

2626
[features]
2727
default = ["std"]

auction/src/weights.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ pub trait WeightInfo {
3737
/// Default weights.
3838
impl WeightInfo for () {
3939
fn bid_collateral_auction() -> Weight {
40-
(108_000_000 as Weight)
41-
.saturating_add(RocksDbWeight::get().reads(8 as Weight))
42-
.saturating_add(RocksDbWeight::get().writes(9 as Weight))
40+
Weight::from_ref_time(108_000_000)
41+
.saturating_add(RocksDbWeight::get().reads(8 as u64))
42+
.saturating_add(RocksDbWeight::get().writes(9 as u64))
4343
}
4444
fn on_finalize(c: u32, ) -> Weight {
45-
(9_779_000 as Weight)
45+
Weight::from_ref_time(9_779_000)
4646
// Standard Error: 13_000
47-
.saturating_add((57_962_000 as Weight).saturating_mul(c as Weight))
48-
.saturating_add(RocksDbWeight::get().reads(10 as Weight))
49-
.saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(c as Weight)))
50-
.saturating_add(RocksDbWeight::get().writes(7 as Weight))
51-
.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(c as Weight)))
47+
.saturating_add(Weight::from_ref_time(57_962_000).saturating_mul(c as u64))
48+
.saturating_add(RocksDbWeight::get().reads(10 as u64))
49+
.saturating_add(RocksDbWeight::get().reads((3 as u64).saturating_mul(c as u64)))
50+
.saturating_add(RocksDbWeight::get().writes(7 as u64))
51+
.saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(c as u64)))
5252
}
5353
}

authority/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ scale-info = { version = "2.1.2", default-features = false, features = ["derive"
1212
serde = { version = "1.0.136", optional = true }
1313
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
1414

15-
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
16-
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
17-
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
18-
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
19-
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.28" }
15+
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
16+
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
17+
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
18+
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
19+
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.29" }
2020

2121
[dev-dependencies]
22-
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
23-
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
24-
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
22+
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
23+
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
24+
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
2525

2626
[features]
2727
default = ["std"]

authority/src/mock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub type BlockNumber = u64;
2424

2525
parameter_types! {
2626
pub BlockWeights: frame_system::limits::BlockWeights =
27-
frame_system::limits::BlockWeights::simple_max(2_000_000_000_000);
27+
frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(2_000_000_000_000));
2828
}
2929

3030
impl frame_system::Config for Runtime {

authority/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ fn trigger_call_works() {
456456

457457
// wrong call weight bound
458458
assert_noop!(
459-
Authority::trigger_call(Origin::signed(1), hash, call_weight_bound - 1),
459+
Authority::trigger_call(Origin::signed(1), hash, call_weight_bound - Weight::from_ref_time(1)),
460460
Error::<Runtime>::WrongCallWeightBound
461461
);
462462

0 commit comments

Comments
 (0)