Skip to content

Commit

Permalink
update to polkadot-v1.10.0 (#994)
Browse files Browse the repository at this point in the history
* polkadot-v1.10.0

* Use scheduler v3::Named instead of v1

* allow deprecated schedule::v1 api
  • Loading branch information
clangenb committed Apr 17, 2024
1 parent 9af1fa5 commit 26d89d3
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 31 deletions.
60 changes: 30 additions & 30 deletions Cargo.dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,35 @@ 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"] }

cumulus-pallet-xcm = { version = "0.10.0", default-features = false }
cumulus-primitives-core = { version = "0.10.0", default-features = false }
frame-benchmarking = { version = "31.0.0", default-features = false }
frame-support = { version = "31.0.0", default-features = false }
frame-system = { version = "31.0.0", default-features = false }
pallet-balances = { version = "31.0.0", default-features = false }
pallet-elections-phragmen = { version = "32.0.0", default-features = false }
pallet-message-queue = { version = "34.0.0", default-features = false }
pallet-preimage = { version = "31.0.0", default-features = false }
pallet-root-testing = { version = "7.0.0", default-features = false }
pallet-scheduler = { version = "32.0.0", default-features = false }
pallet-timestamp = { version = "30.0.0", default-features = false }
pallet-treasury = { version = "30.0.0", default-features = false }
pallet-xcm = { version = "10.0.0", default-features = false }
polkadot-parachain-primitives = { version = "9.0.0", default-features = false }
polkadot-runtime-common = { version = "10.0.0", default-features = false }
polkadot-runtime-parachains = { version = "10.0.0", default-features = false }
sp-api = { version = "29.0.0", default-features = false }
sp-application-crypto = { version = "33.0.0", default-features = false }
sp-arithmetic = { version = "25.0.0", default-features = false }
sp-core = { version = "31.0.0", default-features = false }
sp-io = { version = "33.0.0", default-features = false }
sp-runtime = { version = "34.0.0", default-features = false }
sp-runtime-interface = { version = "26.0.0", default-features = false }
sp-staking = { version = "29.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.11.0", default-features = false }
cumulus-primitives-core = { version = "0.11.0", default-features = false }
frame-benchmarking = { version = "32.0.0", default-features = false }
frame-support = { version = "32.0.0", default-features = false }
frame-system = { version = "32.0.0", default-features = false }
pallet-balances = { version = "33.0.0", default-features = false }
pallet-elections-phragmen = { version = "33.0.0", default-features = false }
pallet-message-queue = { version = "35.0.0", default-features = false }
pallet-preimage = { version = "32.0.0", default-features = false }
pallet-root-testing = { version = "8.0.0", default-features = false }
pallet-scheduler = { version = "33.0.0", default-features = false }
pallet-timestamp = { version = "31.0.0", default-features = false }
pallet-treasury = { version = "31.0.0", default-features = false }
pallet-xcm = { version = "11.0.0", default-features = false }
polkadot-parachain-primitives = { version = "10.0.0", default-features = false }
polkadot-runtime-common = { version = "11.0.0", default-features = false }
polkadot-runtime-parachains = { version = "11.0.0", default-features = false }
sp-api = { version = "30.0.0", default-features = false }
sp-application-crypto = { version = "34.0.0", default-features = false }
sp-arithmetic = { version = "26.0.0", default-features = false }
sp-core = { version = "32.0.0", default-features = false }
sp-io = { version = "34.0.0", default-features = false }
sp-runtime = { version = "35.0.0", default-features = false }
sp-runtime-interface = { version = "27.0.0", default-features = false }
sp-staking = { version = "30.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-storage = { version = "20.0.0", default-features = false }
xcm = { version = "10.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "10.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "10.0.0", package = "staging-xcm-executor", default-features = false }
sp-storage = { version = "21.0.0", default-features = false }
xcm = { version = "11.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "11.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "11.0.0", package = "staging-xcm-executor", default-features = false }

xcm-simulator = { version = "10.0.0" }
xcm-simulator = { version = "11.0.0" }
3 changes: 3 additions & 0 deletions asset-registry/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ impl Config for XcmConfig {
type SafeCallFilter = Everything;
type Aliasers = Nothing;
type TransactionalProcessor = ();
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand Down
4 changes: 4 additions & 0 deletions asset-registry/src/mock/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ impl Config for XcmConfig {
type SafeCallFilter = Everything;
type Aliasers = Nothing;
type TransactionalProcessor = ();
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
}

pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, KusamaNetwork>;
Expand Down Expand Up @@ -187,6 +190,7 @@ impl pallet_message_queue::Config for Runtime {
type QueueChangeHandler = ();
type QueuePausedQuery = ();
type WeightInfo = ();
type IdleMaxServiceWeight = ();
}

construct_runtime!(
Expand Down
11 changes: 10 additions & 1 deletion authority/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use frame_support::{
dispatch::{DispatchClass, GetDispatchInfo, Pays},
pallet_prelude::*,
traits::{
schedule::{v1::Named as ScheduleNamed, DispatchTime, Priority},
schedule::{DispatchTime, Priority},
EitherOfDiverse, EnsureOrigin, Get, IsType, OriginTrait,
},
};
Expand All @@ -45,6 +45,10 @@ use sp_runtime::{
};
use sp_std::prelude::*;

// Todo: Switch to current v3 api: https://github.com/open-web3-stack/open-runtime-module-library/issues/995
#[allow(deprecated)]
use frame_support::traits::schedule::v1::Named as ScheduleNamed;

mod mock;
mod tests;
mod weights;
Expand Down Expand Up @@ -215,6 +219,7 @@ pub mod module {
+ GetDispatchInfo;

/// The Scheduler.
#[allow(deprecated)]
type Scheduler: ScheduleNamed<BlockNumberFor<Self>, <Self as Config>::RuntimeCall, Self::PalletsOrigin>;

/// The type represent origin that can be dispatched by other origins.
Expand Down Expand Up @@ -357,6 +362,7 @@ pub mod module {
};
let pallets_origin = schedule_origin.caller().clone();

#[allow(deprecated)]
T::Scheduler::schedule_named(
Encode::encode(&(&pallets_origin, id)),
when,
Expand Down Expand Up @@ -394,6 +400,7 @@ pub mod module {
};

T::AuthorityConfig::check_fast_track_schedule(origin, &initial_origin, new_delay)?;
#[allow(deprecated)]
T::Scheduler::reschedule_named((&initial_origin, task_id).encode(), when)
.map_err(|_| Error::<T>::FailedToFastTrack)?;

Expand All @@ -416,6 +423,7 @@ pub mod module {
) -> DispatchResult {
T::AuthorityConfig::check_delay_schedule(origin, &initial_origin)?;

#[allow(deprecated)]
T::Scheduler::reschedule_named(
(&initial_origin, task_id).encode(),
DispatchTime::After(additional_delay),
Expand All @@ -442,6 +450,7 @@ pub mod module {
task_id: ScheduleTaskIndex,
) -> DispatchResult {
T::AuthorityConfig::check_cancel_schedule(origin, &initial_origin)?;
#[allow(deprecated)]
T::Scheduler::cancel_named((&initial_origin, task_id).encode()).map_err(|_| Error::<T>::FailedToCancel)?;

Self::deposit_event(Event::Cancelled {
Expand Down
3 changes: 3 additions & 0 deletions xtokens/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ impl Config for XcmConfig {
type SafeCallFilter = Everything;
type Aliasers = ();
type TransactionalProcessor = ();
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand Down
3 changes: 3 additions & 0 deletions xtokens/src/mock/para_relative_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ impl Config for XcmConfig {
type SafeCallFilter = Everything;
type Aliasers = ();
type TransactionalProcessor = ();
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand Down
3 changes: 3 additions & 0 deletions xtokens/src/mock/para_teleport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ impl Config for XcmConfig {
type SafeCallFilter = Everything;
type Aliasers = ();
type TransactionalProcessor = ();
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand Down
4 changes: 4 additions & 0 deletions xtokens/src/mock/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ impl Config for XcmConfig {
type SafeCallFilter = Everything;
type Aliasers = ();
type TransactionalProcessor = ();
type HrmpNewChannelOpenRequestHandler = ();
type HrmpChannelAcceptedHandler = ();
type HrmpChannelClosingHandler = ();
}

pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, KusamaNetwork>;
Expand Down Expand Up @@ -193,6 +196,7 @@ impl pallet_message_queue::Config for Runtime {
type QueueChangeHandler = ();
type QueuePausedQuery = ();
type WeightInfo = ();
type IdleMaxServiceWeight = ();
}

construct_runtime!(
Expand Down

0 comments on commit 26d89d3

Please sign in to comment.