mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
Deprecate scheduler traits v1 and v2 (#3718)
This PR add `#[deprecated]` attribute to v1 and v2 of the schedule trait. Proposed in this issue: https://github.com/paritytech/polkadot-sdk/issues/3676 ```rust #[allow(deprecated)] #[deprecated = "traits::schedule::v1 is deprecated. Please use v3 instead."] pub mod v1 { ... } #[allow(deprecated)] #[deprecated = "traits::schedule::v2 is deprecated. Please use v3 instead."] pub mod v2 { ... } ``` polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
This commit is contained in:
@@ -130,7 +130,7 @@ impl<T: Decode, H> MaybeHashed<T, H> {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: deprecate
|
||||
#[deprecated(note = "Use `v3` instead. Will be removed after September 2024.")]
|
||||
pub mod v1 {
|
||||
use super::*;
|
||||
|
||||
@@ -218,10 +218,12 @@ pub mod v1 {
|
||||
fn next_dispatch_time(id: Vec<u8>) -> Result<BlockNumber, ()>;
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl<T, BlockNumber, Call, RuntimeOrigin> Anon<BlockNumber, Call, RuntimeOrigin> for T
|
||||
where
|
||||
T: v2::Anon<BlockNumber, Call, RuntimeOrigin>,
|
||||
{
|
||||
#[allow(deprecated)]
|
||||
type Address = T::Address;
|
||||
|
||||
fn schedule(
|
||||
@@ -232,10 +234,13 @@ pub mod v1 {
|
||||
call: Call,
|
||||
) -> Result<Self::Address, DispatchError> {
|
||||
let c = MaybeHashed::<Call, T::Hash>::Value(call);
|
||||
|
||||
#[allow(deprecated)]
|
||||
T::schedule(when, maybe_periodic, priority, origin, c)
|
||||
}
|
||||
|
||||
fn cancel(address: Self::Address) -> Result<(), ()> {
|
||||
#[allow(deprecated)]
|
||||
T::cancel(address)
|
||||
}
|
||||
|
||||
@@ -243,18 +248,22 @@ pub mod v1 {
|
||||
address: Self::Address,
|
||||
when: DispatchTime<BlockNumber>,
|
||||
) -> Result<Self::Address, DispatchError> {
|
||||
#[allow(deprecated)]
|
||||
T::reschedule(address, when)
|
||||
}
|
||||
|
||||
fn next_dispatch_time(address: Self::Address) -> Result<BlockNumber, ()> {
|
||||
#[allow(deprecated)]
|
||||
T::next_dispatch_time(address)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl<T, BlockNumber, Call, RuntimeOrigin> Named<BlockNumber, Call, RuntimeOrigin> for T
|
||||
where
|
||||
T: v2::Named<BlockNumber, Call, RuntimeOrigin>,
|
||||
{
|
||||
#[allow(deprecated)]
|
||||
type Address = T::Address;
|
||||
|
||||
fn schedule_named(
|
||||
@@ -266,10 +275,12 @@ pub mod v1 {
|
||||
call: Call,
|
||||
) -> Result<Self::Address, ()> {
|
||||
let c = MaybeHashed::<Call, T::Hash>::Value(call);
|
||||
#[allow(deprecated)]
|
||||
T::schedule_named(id, when, maybe_periodic, priority, origin, c)
|
||||
}
|
||||
|
||||
fn cancel_named(id: Vec<u8>) -> Result<(), ()> {
|
||||
#[allow(deprecated)]
|
||||
T::cancel_named(id)
|
||||
}
|
||||
|
||||
@@ -277,16 +288,18 @@ pub mod v1 {
|
||||
id: Vec<u8>,
|
||||
when: DispatchTime<BlockNumber>,
|
||||
) -> Result<Self::Address, DispatchError> {
|
||||
#[allow(deprecated)]
|
||||
T::reschedule_named(id, when)
|
||||
}
|
||||
|
||||
fn next_dispatch_time(id: Vec<u8>) -> Result<BlockNumber, ()> {
|
||||
#[allow(deprecated)]
|
||||
T::next_dispatch_time(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: deprecate
|
||||
#[deprecated(note = "Use `v3` instead. Will be removed after September 2024.")]
|
||||
pub mod v2 {
|
||||
use super::*;
|
||||
|
||||
@@ -478,4 +491,5 @@ pub mod v3 {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub use v1::*;
|
||||
|
||||
Reference in New Issue
Block a user