This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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 <>
- Loading branch information
Showing
5 changed files
with
141 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use frame_benchmarking::v2::*; | ||
#[allow(unused_imports)] | ||
use frame_support_test::Config; | ||
use frame_support_test::Call; | ||
|
||
#[benchmarks] | ||
mod benches { | ||
use super::*; | ||
|
||
#[benchmark] | ||
fn bench() { | ||
#[extrinsic_call] | ||
thing(1); | ||
} | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
frame/support/test/tests/benchmark_ui/invalid_origin.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error[E0599]: no variant or associated item named `new_call_variant_thing` found for enum `Call` in the current scope | ||
--> tests/benchmark_ui/invalid_origin.rs:6:1 | ||
| | ||
6 | #[benchmarks] | ||
| ^^^^^^^^^^^^^ variant or associated item not found in `Call<T>` | ||
| | ||
= note: this error originates in the attribute macro `benchmarks` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: the trait bound `<T as frame_support_test::Config>::RuntimeOrigin: From<{integer}>` is not satisfied | ||
--> tests/benchmark_ui/invalid_origin.rs:6:1 | ||
| | ||
6 | #[benchmarks] | ||
| ^^^^^^^^^^^^^ the trait `From<{integer}>` is not implemented for `<T as frame_support_test::Config>::RuntimeOrigin` | ||
| | ||
= note: required for `{integer}` to implement `Into<<T as frame_support_test::Config>::RuntimeOrigin>` | ||
= note: this error originates in the attribute macro `benchmarks` (in Nightly builds, run with -Z macro-backtrace for more info) |