-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add ensure_pow method #13042
Add ensure_pow method #13042
Conversation
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.
Please add some minimal success tests or merge in #13043 and use the test structure from there.
I've implemented |
Dont know what is better here. Maybe there can be types that are not |
Added tests. I think all pending comments are "solved" for now. I've opened an issue rust-num/num-traits#254 trying to get more info in order to know the best possible design decision for doing it as a function or as a trait method. But I think is not blocking, so if you are ok with it right now, it's ok for me. |
(Looks like the CI does not notice when you dismiss reviews 🤔) Merging now since there were no changes since Basti last reviewed. |
bot merge |
Yes, it was weird, the review button switched between you and your partner, instead of selecting both 🤷♂️. Anyways, thanks for your reviews! 🙌🏻 |
* add ensure_pow method * reexport checked_pow and ensure_pow
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-37/1736/1 |
* add ensure_pow method * reexport checked_pow and ensure_pow
* add ensure_pow method * reexport checked_pow and ensure_pow
This PR extends #12967 with the
ensure_pow
function. I think this is also an interesting function to have along with theensure_ops
family methods.ensure_pow
acts similarly tochecked_pow
but returns anArithmeticError
instead.Related #12754