-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
Will add an example soon |
frame/lottery/src/benchmarking.rs
Outdated
} | ||
|
||
start_lottery { | ||
/* |
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.
Will move rest of them soon
This looks good to me as long as it works with the existing examples. Love the simple Also in this PR we will want to add passing and failing UI tests (maybe choose a non-cast expr type that is also invalid with the existing syntax as one of the failing examples), and we will want the docs for benchmark v2 updated so people know about this syntax :) |
bot fmt |
@gupnik https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2656974 was started for your command Comment |
@gupnik Command |
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.
This looks good to me once everything is passing, good end-to-end example with the lottery pallet, and the negative UI test looks good
frame/benchmarking/src/lib.rs
Outdated
@@ -160,6 +160,12 @@ 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`, this is the general syntax: |
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_origin
means or a link to elsewhere in the docs where this is explained
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.
Updated. Please let me know if this works.
Did you look at the CI output? Something with the
|
yeah I'm going back and forth helping him debug it and removed my review haha |
Yes, looking into this |
bot fmt |
@gupnik https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2717436 was started for your command Comment |
@gupnik Command |
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.
thanks looks good!
Could you still please extend the description a bit to show how the V1 syntax of this looked like?
I will try to migrate another pallet to see that it works there as well.
* 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 <>
* 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 <>
Fixes #13721
In benchmarking v1, we used to be able to do:
With this change, the syntax in v2 would look like: