Utility: add more tests for batch/batchAll/forceBatch (#12506)

* Utility: add more tests for batch/batchAll/forceBatch

* remove unnecessary

* batch works with council

* add more tests

* better call examples

* shorter code

* Update frame/utility/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/utility/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/utility/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* update TestBaseCallFilter

* fix

* fix?

* fix

Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Sergej Sakac
2022-10-28 17:18:09 +02:00
committed by GitHub
parent 9c1af65012
commit a1f8a74a37
4 changed files with 232 additions and 11 deletions
+9 -9
View File
@@ -164,13 +164,13 @@ pub mod pallet {
impl<T: Config> Pallet<T> {
/// Send a batch of dispatch calls.
///
/// May be called from any origin.
/// May be called from any origin except `None`.
///
/// - `calls`: The calls to be dispatched from the same origin. The number of call must not
/// exceed the constant: `batched_calls_limit` (available in constant metadata).
///
/// If origin is root then call are dispatch without checking origin filter. (This includes
/// bypassing `frame_system::Config::BaseCallFilter`).
/// If origin is root then the calls are dispatched without checking origin filter. (This
/// includes bypassing `frame_system::Config::BaseCallFilter`).
///
/// # <weight>
/// - Complexity: O(C) where C is the number of calls to be batched.
@@ -291,13 +291,13 @@ pub mod pallet {
/// Send a batch of dispatch calls and atomically execute them.
/// The whole transaction will rollback and fail if any of the calls failed.
///
/// May be called from any origin.
/// May be called from any origin except `None`.
///
/// - `calls`: The calls to be dispatched from the same origin. The number of call must not
/// exceed the constant: `batched_calls_limit` (available in constant metadata).
///
/// If origin is root then call are dispatch without checking origin filter. (This includes
/// bypassing `frame_system::Config::BaseCallFilter`).
/// If origin is root then the calls are dispatched without checking origin filter. (This
/// includes bypassing `frame_system::Config::BaseCallFilter`).
///
/// # <weight>
/// - Complexity: O(C) where C is the number of calls to be batched.
@@ -403,13 +403,13 @@ pub mod pallet {
/// Send a batch of dispatch calls.
/// Unlike `batch`, it allows errors and won't interrupt.
///
/// May be called from any origin.
/// May be called from any origin except `None`.
///
/// - `calls`: The calls to be dispatched from the same origin. The number of call must not
/// exceed the constant: `batched_calls_limit` (available in constant metadata).
///
/// If origin is root then call are dispatch without checking origin filter. (This includes
/// bypassing `frame_system::Config::BaseCallFilter`).
/// If origin is root then the calls are dispatch without checking origin filter. (This
/// includes bypassing `frame_system::Config::BaseCallFilter`).
///
/// # <weight>
/// - Complexity: O(C) where C is the number of calls to be batched.