-
Notifications
You must be signed in to change notification settings - Fork 695
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-child-bounties benchmark to v2 #6310
Migrate pallet-child-bounties benchmark to v2 #6310
Conversation
I already pick |
Apologies, I must have missed that since I haven't seen a PR for it today. |
@@ -105,7 +99,7 @@ fn activate_bounty<T: Config>( | |||
) -> Result<BenchmarkChildBounty<T>, BenchmarkError> { | |||
let mut child_bounty_setup = setup_child_bounty::<T>(user, description); | |||
let curator_lookup = T::Lookup::unlookup(child_bounty_setup.curator.clone()); | |||
Bounties::<T>::propose_bounty( | |||
pallet_bounties::Pallet::<T>::propose_bounty( |
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.
Not wrong, but just asking: why the renames?
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.
Hmm, just syncing style with other benchmarks.
I also found that there're some frame_system::Pallet
in this file. I think this is more clear?
But I'm ok with both style.
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 for these kinds of PRs, minimizing the diff is more important than having cross pallet styling
/cmd prdoc --bump patch --audience runtime_dev |
assert!( | ||
T::Currency::free_balance(&beneficiary_account).is_zero(), | ||
"Beneficiary already has balance." | ||
); |
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.
ensure is better than assert, because the benchmarking pipeline can handle errors
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.
For example, it will output logs or data, whereas a panic will not
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.
Didn't think about this before.
Since I encountered a lot of benchmarking code, assert!
is used more frequently. I will revert this and create an issue for discussion.
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 would block here on keeping ensure
/tip small @AurevoirXavier I am counting approximately every 2 pallets as a small tip, so i wont make this call on every PR :) hope that is sensible |
@shawntabrizi Invalid tip size. Please specify one of small, medium, large. |
/tip small |
@shawntabrizi A referendum for a small (20 DOT) tip was successfully submitted for @AurevoirXavier (156HGo9setPcU2qhFMVWLkcmtCEGySLwNqa3DaEiYSWtte4Y on polkadot). |
The referendum has appeared on Polkassembly. |
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.
fmt
and then it's ready to merge
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.
CI error to fix
error: cannot find macro `vec` in this scope
--> /__w/polkadot-sdk/polkadot-sdk/substrate/frame/child-bounties/src/benchmarking.rs:76:15
|
76 | let reason = vec![0; description as usize];
| ^^^
|
b570baf
Part of: