Feature gate do_task in frame_system (#2707)

https://github.com/paritytech/polkadot-sdk/pull/1343/ introduced Tasks
API. This one moves `do_task` call in frame_system under the
experimental flag, till the previous one is audited.

---------

Co-authored-by: command-bot <>
This commit is contained in:
gupnik
2023-12-15 11:17:19 +05:30
committed by GitHub
parent 2cee874742
commit 11edbaf6c0
8 changed files with 32 additions and 5 deletions
+9 -1
View File
@@ -323,9 +323,11 @@ pub mod pallet {
#[inject_runtime_type]
type RuntimeCall = ();
/// Converts a module to the index of the module, injected by `construct_runtime!`.
/// The aggregated Task type, injected by `construct_runtime!`.
#[inject_runtime_type]
type RuntimeTask = ();
/// Converts a module to the index of the module, injected by `construct_runtime!`.
#[inject_runtime_type]
type PalletInfo = ();
@@ -637,6 +639,7 @@ pub mod pallet {
Ok(().into())
}
#[cfg(feature = "experimental")]
#[pallet::call_index(8)]
#[pallet::weight(task.weight())]
pub fn do_task(origin: OriginFor<T>, task: T::RuntimeTask) -> DispatchResultWithPostInfo {
@@ -675,10 +678,13 @@ pub mod pallet {
KilledAccount { account: T::AccountId },
/// On on-chain remark happened.
Remarked { sender: T::AccountId, hash: T::Hash },
#[cfg(feature = "experimental")]
/// A [`Task`] has started executing
TaskStarted { task: T::RuntimeTask },
#[cfg(feature = "experimental")]
/// A [`Task`] has finished executing.
TaskCompleted { task: T::RuntimeTask },
#[cfg(feature = "experimental")]
/// A [`Task`] failed during execution.
TaskFailed { task: T::RuntimeTask, err: DispatchError },
}
@@ -702,8 +708,10 @@ pub mod pallet {
NonZeroRefCount,
/// The origin filter prevent the call to be dispatched.
CallFiltered,
#[cfg(feature = "experimental")]
/// The specified [`Task`] is not valid.
InvalidTask,
#[cfg(feature = "experimental")]
/// The specified [`Task`] failed during execution.
FailedTask,
}