This repository was 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.7k
Adds force_origin support #13845
Merged
Merged
Adds force_origin support #13845
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
37a3401
Adds force_origin support
codekitz 42a4ee1
Moves a couple of tests to showcase v2 with force_origin
codekitz b3dad21
Adds remaining tests
codekitz b0b42a5
adds documentation
codekitz eb5b6b5
minor
codekitz 925bd4c
adds test for invalid origin
codekitz f2d8190
".git/.scripts/commands/fmt/fmt.sh"
a210736
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
codekitz cc3e4d4
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
codekitz 7f80f26
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
codekitz 3c9b744
updates param to use MaxCalls
codekitz 24bf5de
Fixes compilation error
gupnik 1f0aeac
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik cad02d9
Updates doc comment
gupnik 2c52659
Fixes test outputs
gupnik 60809ae
Fixes test output
gupnik a3e7e30
".git/.scripts/commands/fmt/fmt.sh"
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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() {} |
18 changes: 18 additions & 0 deletions
18
frame/support/test/tests/benchmark_ui/invalid_origin.stderr
This file contains hidden or 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,18 @@ | ||
| error[E0599]: no variant or associated item named `new_call_variant_thing` found for enum `frame_support_test::Call` in the current scope | ||
| --> tests/benchmark_ui/invalid_origin.rs:6:1 | ||
| | | ||
| 6 | #[benchmarks] | ||
| | ^^^^^^^^^^^^^ variant or associated item not found in `frame_support_test::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:13:9 | ||
| | | ||
| 6 | #[benchmarks] | ||
| | ------------- required by a bound introduced by this call | ||
| ... | ||
| 13 | thing(1); | ||
| | ^ 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>` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps a sentence or two explaining what
force_originmeans or a link to elsewhere in the docs where this is explainedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Please let me know if this works.