Skip to content

Commit 0abce5c

Browse files
authored
use crates.io (#961)
* use crates.io * bump upstreams * fix * fix * fix * test for extract * remove unused code
1 parent 951ed3d commit 0abce5c

File tree

20 files changed

+261
-153
lines changed

20 files changed

+261
-153
lines changed

Cargo.dev.toml

Lines changed: 68 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -35,70 +35,72 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive
3535
serde = { version = "1.0.189" }
3636
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["max-encoded-len"] }
3737

38-
frame-benchmarking = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
39-
frame-support = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
40-
frame-system = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
41-
pallet-authority-discovery = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
42-
pallet-authorship = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
43-
pallet-babe = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
44-
pallet-balances = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
45-
pallet-elections-phragmen = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
46-
pallet-message-queue = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
47-
pallet-scheduler = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
48-
pallet-session = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
49-
pallet-staking = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
50-
pallet-timestamp = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
51-
pallet-treasury = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
52-
pallet-vesting = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
53-
pallet-transaction-payment = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
54-
pallet-preimage = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
55-
pallet-root-testing = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
56-
sp-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
57-
sp-application-crypto = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
58-
sp-arithmetic = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
59-
sp-authority-discovery = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
60-
sp-blockchain = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
61-
sp-consensus = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
62-
sp-consensus-slots = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
63-
sp-core = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
64-
sp-debug-derive = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
65-
sp-externalities = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
66-
sp-inherents = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
67-
sp-io = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
68-
sp-keystore = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
69-
sp-npos-elections = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
70-
sp-panic-handler = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
71-
sp-runtime = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
72-
sp-runtime-interface = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
73-
sp-session = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
74-
sp-staking = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
75-
sp-state-machine = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
76-
sp-std = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
77-
sp-storage = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
78-
sp-timestamp = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
79-
sp-trie = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
80-
sp-version = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
81-
sp-wasm-interface = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
82-
sp-tracing = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
83-
sp-maybe-compressed-blob = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
84-
sp-weights = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
85-
cumulus-primitives-core = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
86-
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
87-
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
88-
cumulus-pallet-xcm = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
89-
parachain-info = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
90-
pallet-xcm = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
91-
polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
92-
polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
93-
polkadot-parachain-primitives = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
94-
polkadot-primitives = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
95-
xcm = { package = "staging-xcm", git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
96-
xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
97-
xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
38+
cumulus-pallet-dmp-queue = { version = "0.4.0", default-features = false }
39+
cumulus-pallet-parachain-system = { version = "0.4.0", default-features = false }
40+
cumulus-pallet-xcm = { version = "0.4.0", default-features = false }
41+
cumulus-pallet-xcmp-queue = { version = "0.4.0", default-features = false }
42+
cumulus-primitives-core = { version = "0.4.0", default-features = false }
43+
frame-benchmarking = { version = "25.0.0", default-features = false }
44+
frame-support = { version = "25.0.0", default-features = false }
45+
frame-system = { version = "25.0.0", default-features = false }
46+
pallet-authority-discovery = { version = "25.0.0", default-features = false }
47+
pallet-authorship = { version = "25.0.0", default-features = false }
48+
pallet-babe = { version = "25.0.0", default-features = false }
49+
pallet-balances = { version = "25.0.0", default-features = false }
50+
pallet-elections-phragmen = { version = "26.0.0", default-features = false }
51+
pallet-message-queue = { version = "28.0.0", default-features = false }
52+
pallet-preimage = { version = "25.0.0", default-features = false }
53+
pallet-root-testing = { version = "1.0.0", default-features = false }
54+
pallet-scheduler = { version = "26.0.0", default-features = false }
55+
pallet-session = { version = "25.0.0", default-features = false }
56+
pallet-staking = { version = "25.0.0", default-features = false }
57+
pallet-timestamp = { version = "24.0.0", default-features = false }
58+
pallet-transaction-payment = { version = "25.0.0", default-features = false }
59+
pallet-treasury = { version = "24.0.0", default-features = false }
60+
pallet-vesting = { version = "25.0.0", default-features = false }
61+
pallet-xcm = { version = "4.0.0", default-features = false }
62+
parachain-info = { package = "staging-parachain-info", version = "0.4.0", default-features = false }
63+
polkadot-core-primitives = { version = "4.0.0", default-features = false }
64+
polkadot-parachain-primitives = { version = "3.0.0", default-features = false }
65+
polkadot-primitives = { version = "4.0.0", default-features = false }
66+
polkadot-runtime-common = { version = "4.0.0", default-features = false }
67+
polkadot-runtime-parachains = { version = "4.0.0", default-features = false }
68+
sp-api = { version = "23.0.0", default-features = false }
69+
sp-application-crypto = { version = "27.0.0", default-features = false }
70+
sp-arithmetic = { version = "20.0.0", default-features = false }
71+
sp-authority-discovery = { version = "23.0.0", default-features = false }
72+
sp-blockchain = { version = "25.0.0", default-features = false }
73+
sp-consensus = { version = "0.29.0", default-features = false }
74+
sp-consensus-slots = { version = "0.29.0", default-features = false }
75+
sp-core = { version = "25.0.0", default-features = false }
76+
sp-debug-derive = { version = "12.0.0", default-features = false }
77+
sp-externalities = { version = "0.23.0", default-features = false }
78+
sp-inherents = { version = "23.0.0", default-features = false }
79+
sp-io = { version = "27.0.0", default-features = false }
80+
sp-keystore = { version = "0.31.0", default-features = false }
81+
sp-maybe-compressed-blob = { version = "9.0.0", default-features = false }
82+
sp-npos-elections = { version = "23.0.0", default-features = false }
83+
sp-panic-handler = { version = "12.0.0", default-features = false }
84+
sp-runtime = { version = "28.0.0", default-features = false }
85+
sp-runtime-interface = { version = "21.0.0", default-features = false }
86+
sp-session = { version = "24.0.0", default-features = false }
87+
sp-staking = { version = "23.0.0", default-features = false }
88+
sp-state-machine = { version = "0.32.0", default-features = false }
89+
sp-std = { version = "12.0.0", default-features = false }
90+
sp-storage = { version = "17.0.0", default-features = false }
91+
sp-timestamp = { version = "23.0.0", default-features = false }
92+
sp-tracing = { version = "14.0.0", default-features = false }
93+
sp-trie = { version = "26.0.0", default-features = false }
94+
sp-version = { version = "26.0.0", default-features = false }
95+
sp-wasm-interface = { version = "18.0.0", default-features = false }
96+
sp-weights = { version = "24.0.0", default-features = false }
97+
xcm = { package = "staging-xcm", version = "4.0.0", default-features = false }
98+
xcm-builder = { package = "staging-xcm-builder", version = "4.0.0", default-features = false }
99+
xcm-executor = { package = "staging-xcm-executor", version = "4.0.0", default-features = false }
98100

99-
xcm-simulator = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
100-
sc-client-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
101-
sc-client-db = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
102-
sc-executor = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
103-
sc-executor-common = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
104-
sc-utils = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" }
101+
sc-client-api = { version = "25.0.0" }
102+
sc-client-db = { version = "0.32.0" }
103+
sc-executor = { version = "0.29.0" }
104+
sc-executor-common = { version = "0.26.0" }
105+
sc-utils = { version = "11.0.0" }
106+
xcm-simulator = { version = "4.0.0" }

asset-registry/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ cumulus-primitives-core = { workspace = true, features = ["std"] }
4141
cumulus-pallet-dmp-queue = { workspace = true, features = ["std"] }
4242
cumulus-pallet-xcmp-queue = { workspace = true, features = ["std"] }
4343
cumulus-pallet-xcm = { workspace = true, features = ["std"] }
44+
cumulus-pallet-parachain-system = { workspace = true, features = ["std"] }
4445
parachain-info = { workspace = true, features = ["std"] }
4546

4647
# polkadot
4748
polkadot-parachain-primitives = { workspace = true, features = ["std"] }
4849
polkadot-runtime-parachains = { workspace = true, features = ["std"] }
50+
polkadot-runtime-common = { workspace = true, features = ["std"] }
4951
xcm-simulator = { workspace = true }
5052

5153
# orml
@@ -78,6 +80,8 @@ runtime-benchmarks = [
7880
"sp-runtime/runtime-benchmarks",
7981
"xcm-builder/runtime-benchmarks",
8082
"xcm-executor/runtime-benchmarks",
83+
"polkadot-runtime-parachains/runtime-benchmarks",
84+
"polkadot-runtime-common/runtime-benchmarks",
8185
]
8286
try-runtime = [
8387
"frame-support/try-runtime",

asset-registry/src/migrations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod v2 {
2222

2323
pub(crate) fn migrate<T: Config>() -> Weight {
2424
let mut weight: Weight = Weight::zero();
25-
let module_prefix = LocationToAssetId::<T>::module_prefix();
25+
let module_prefix = LocationToAssetId::<T>::pallet_prefix();
2626
let storage_prefix = LocationToAssetId::<T>::storage_prefix();
2727

2828
weight.saturating_accrue(T::DbWeight::get().reads(1));

asset-registry/src/mock/para.rs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use super::{Amount, Balance, CurrencyId, CurrencyIdConvert, ParachainXcmRouter};
22

33
use crate as orml_asset_registry;
44

5-
use cumulus_primitives_core::{ChannelStatus, GetChannelInfo, ParaId};
5+
use cumulus_pallet_parachain_system::AnyRelayNumber;
6+
use cumulus_primitives_core::ParaId;
67
use frame_support::traits::{EnsureOrigin, EnsureOriginWithArg};
78
use frame_support::{
89
construct_runtime, match_types, ord_parameter_types, parameter_types,
@@ -20,6 +21,7 @@ use orml_xcm_support::{IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset}
2021
use pallet_xcm::XcmPassthrough;
2122
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
2223
use polkadot_parachain_primitives::primitives::Sibling;
24+
use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery;
2325
use sp_core::H256;
2426
use sp_runtime::{
2527
traits::{AccountIdConversion, Convert, IdentityLookup},
@@ -57,7 +59,7 @@ impl frame_system::Config for Runtime {
5759
type BaseCallFilter = Everything;
5860
type SystemWeightInfo = ();
5961
type SS58Prefix = ();
60-
type OnSetCode = ();
62+
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Runtime>;
6163
type MaxConsumers = ConstU32<16>;
6264
}
6365

@@ -72,6 +74,7 @@ impl pallet_balances::Config for Runtime {
7274
type MaxReserves = ConstU32<50>;
7375
type ReserveIdentifier = [u8; 8];
7476
type RuntimeHoldReason = RuntimeHoldReason;
77+
type RuntimeFreezeReason = RuntimeFreezeReason;
7578
type FreezeIdentifier = [u8; 8];
7679
type MaxHolds = ();
7780
type MaxFreezes = ();
@@ -261,26 +264,28 @@ impl Config for XcmConfig {
261264
type Aliasers = Nothing;
262265
}
263266

264-
pub struct ChannelInfo;
265-
impl GetChannelInfo for ChannelInfo {
266-
fn get_channel_status(_id: ParaId) -> ChannelStatus {
267-
ChannelStatus::Ready(10, 10)
268-
}
269-
fn get_channel_max(_id: ParaId) -> Option<usize> {
270-
Some(usize::max_value())
271-
}
267+
impl cumulus_pallet_parachain_system::Config for Runtime {
268+
type RuntimeEvent = RuntimeEvent;
269+
type OnSystemEvent = ();
270+
type SelfParaId = ();
271+
type OutboundXcmpMessageSource = XcmpQueue;
272+
type DmpMessageHandler = ();
273+
type ReservedDmpWeight = ();
274+
type XcmpMessageHandler = XcmpQueue;
275+
type ReservedXcmpWeight = ();
276+
type CheckAssociatedRelayNumber = AnyRelayNumber;
272277
}
273278

274279
impl cumulus_pallet_xcmp_queue::Config for Runtime {
275280
type RuntimeEvent = RuntimeEvent;
276281
type XcmExecutor = XcmExecutor<XcmConfig>;
277-
type ChannelInfo = ChannelInfo;
282+
type ChannelInfo = ParachainSystem;
278283
type VersionWrapper = ();
279284
type ExecuteOverweightOrigin = EnsureRoot<AccountId>;
280285
type ControllerOrigin = EnsureRoot<AccountId>;
281286
type ControllerOriginConverter = XcmOriginToCallOrigin;
282287
type WeightInfo = ();
283-
type PriceForSiblingDelivery = ();
288+
type PriceForSiblingDelivery = NoPriceForMessageDelivery<ParaId>;
284289
}
285290

286291
impl cumulus_pallet_dmp_queue::Config for Runtime {
@@ -397,6 +402,7 @@ construct_runtime!(
397402
Balances: pallet_balances,
398403

399404
ParachainInfo: parachain_info,
405+
ParachainSystem: cumulus_pallet_parachain_system,
400406
XcmpQueue: cumulus_pallet_xcmp_queue,
401407
DmpQueue: cumulus_pallet_dmp_queue,
402408
CumulusXcm: cumulus_pallet_xcm,

asset-registry/src/mock/relay.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ impl pallet_balances::Config for Runtime {
6161
type MaxReserves = ConstU32<50>;
6262
type ReserveIdentifier = [u8; 8];
6363
type RuntimeHoldReason = RuntimeHoldReason;
64+
type RuntimeFreezeReason = RuntimeFreezeReason;
6465
type FreezeIdentifier = [u8; 8];
6566
type MaxHolds = ();
6667
type MaxFreezes = ();

authority/src/mock.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ impl pallet_preimage::Config for Runtime {
5757
type WeightInfo = ();
5858
type Currency = ();
5959
type ManagerOrigin = EnsureRoot<u128>;
60-
type BaseDeposit = ();
61-
type ByteDeposit = ();
60+
type Consideration = ();
6261
}
6362

6463
parameter_types! {

currencies/src/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl pallet_balances::Config for Runtime {
6060
type ReserveIdentifier = ReserveIdentifier;
6161
type WeightInfo = ();
6262
type RuntimeHoldReason = RuntimeHoldReason;
63+
type RuntimeFreezeReason = RuntimeFreezeReason;
6364
type FreezeIdentifier = [u8; 8];
6465
type MaxHolds = ();
6566
type MaxFreezes = ();

tokens/src/imbalances.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> Imbalance<T::Balance> for Pos
102102
fn peek(&self) -> T::Balance {
103103
self.0
104104
}
105+
106+
fn extract(&mut self, amount: T::Balance) -> Self {
107+
let new: T::Balance = self.0.min(amount);
108+
self.0 -= new;
109+
Self::new(new)
110+
}
105111
}
106112

107113
impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> TryDrop for NegativeImbalance<T, GetCurrencyId> {
@@ -157,6 +163,12 @@ impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> Imbalance<T::Balance> for Neg
157163
fn peek(&self) -> T::Balance {
158164
self.0
159165
}
166+
167+
fn extract(&mut self, amount: T::Balance) -> Self {
168+
let new: T::Balance = self.0.min(amount);
169+
self.0 -= new;
170+
Self::new(new)
171+
}
160172
}
161173

162174
impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> Drop for PositiveImbalance<T, GetCurrencyId> {

0 commit comments

Comments
 (0)