mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 09:57:56 +00:00
allow to specify schedule time as a relative value (#6578)
* allow to specify schedule time as a relative value * bump version * line width * fix benchmarks * rename and updates
This commit is contained in:
@@ -1490,6 +1490,15 @@ pub mod schedule {
|
||||
/// higher priority.
|
||||
pub type Priority = u8;
|
||||
|
||||
/// The dispatch time of a scheduled task.
|
||||
#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug)]
|
||||
pub enum DispatchTime<BlockNumber> {
|
||||
/// At specified block.
|
||||
At(BlockNumber),
|
||||
/// After specified number of blocks.
|
||||
After(BlockNumber),
|
||||
}
|
||||
|
||||
/// The highest priority. We invert the value so that normal sorting will place the highest
|
||||
/// priority at the beginning of the list.
|
||||
pub const HIGHEST_PRIORITY: Priority = 0;
|
||||
@@ -1510,7 +1519,7 @@ pub mod schedule {
|
||||
///
|
||||
/// Infallible.
|
||||
fn schedule(
|
||||
when: BlockNumber,
|
||||
when: DispatchTime<BlockNumber>,
|
||||
maybe_periodic: Option<Period<BlockNumber>>,
|
||||
priority: Priority,
|
||||
origin: Origin,
|
||||
@@ -1540,7 +1549,7 @@ pub mod schedule {
|
||||
/// - `id`: The identity of the task. This must be unique and will return an error if not.
|
||||
fn schedule_named(
|
||||
id: Vec<u8>,
|
||||
when: BlockNumber,
|
||||
when: DispatchTime<BlockNumber>,
|
||||
maybe_periodic: Option<Period<BlockNumber>>,
|
||||
priority: Priority,
|
||||
origin: Origin,
|
||||
|
||||
Reference in New Issue
Block a user