-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate pallet-preimage to benchmark v2 #6277
base: master
Are you sure you want to change the base?
Migrate pallet-preimage to benchmark v2 #6277
Conversation
#[benchmark] | ||
fn request_preimage() { | ||
let o = T::ManagerOrigin::try_successful_origin() | ||
.expect("ManagerOrigin has no successful origin required for the benchmark"); |
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.
Why is this an expect now? The pallet is also usable without manager origin.
It returned BenchmarkError::Weightless
before.
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.
I think that error is meaningless.
Same as:
polkadot-sdk/substrate/frame/treasury/src/benchmarking.rs
Lines 121 to 126 in 06debd0
let origin = | |
T::SpendOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; | |
let beneficiary = T::Lookup::lookup(beneficiary_lookup.clone()).unwrap(); | |
#[extrinsic_call] | |
_(origin as T::RuntimeOrigin, value, beneficiary_lookup); |
It was not part of the benchmark(#[extrinsic_call]
) code block. Additionally, I believe the original .expect
message is more readable. So I reuse it.
What do you suggest?
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.
Also can be found here
.expect("ManagerOrigin has no successful origin required for the benchmark"); |
Part of: