Adds force_origin support (#13845)

* Adds force_origin support

* Moves a couple of tests to showcase v2 with force_origin

* Adds remaining tests

* adds documentation

* minor

* adds test for invalid origin

* ".git/.scripts/commands/fmt/fmt.sh"

* updates param to use MaxCalls

* Fixes compilation error

* Updates doc comment

* Fixes test outputs

* Fixes test output

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
This commit is contained in:
gupnik
2023-04-24 17:34:15 +05:30
committed by GitHub
parent b8d94bfad1
commit 3688575fd0
5 changed files with 141 additions and 61 deletions
+7
View File
@@ -160,6 +160,13 @@ pub use v1::*;
/// The underscore will be substituted with the name of the benchmark (i.e. the name of the
/// function in the benchmark function definition).
///
/// In case of a `force_origin` where you want to elevate the privileges of the provided origin,
/// this is the general syntax:
/// ```ignore
/// #[extrinsic_call]
/// _(force_origin as T::RuntimeOrigin, 0u32.into(), 0);
/// ```
///
/// Regardless of whether `#[extrinsic_call]` or `#[block]` is used, this attribute also serves
/// the purpose of designating the boundary between the setup code portion of the benchmark
/// (everything before the `#[extrinsic_call]` or `#[block]` attribute) and the verification