Open Gioyik opened 1 year ago
there are many panic!
in the fixed_point.rs file that I think can be moved to the safe and unchecked_
function logic.
@ggwpez do you think it's fine to make the switch in those files and include it in this PR or those should stay as panic!
?
bot fmt
@kianenigma https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3320751 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh"
. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment bot cancel 1-78f2445a-1362-4601-9d6a-9cd93bf5bc56
to cancel this command or bot cancel
to cancel all commands in this pull request.
@kianenigma Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh"
has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3320751 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3320751/artifacts/download.
now there are checked_
functions with Result<>
. One question, in these two calls:
https://github.com/paritytech/substrate/blob/gio/checked_fn/primitives/arithmetic/src/per_things.rs#L482 https://github.com/paritytech/substrate/blob/gio/checked_fn/primitives/arithmetic/src/per_things.rs#L495
do we want to replace with the checked version of the function?
The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3321459
The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable-int Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3321465
Fixes paritytech/polkadot-sdk#199
Introduces
checked_div
andchecked_rational_mul_correction
Notes:
checked_div()
inPerThings
have to options to complete the division, however, I am not sure which one would be the best, both seem to output the same.The checked behavior ofchecked_rational_mul_correction
can be introduced formultiply_by_rational_with_rounding
, however it implies changing all the tests and developers using it might need to change it to expectOption<u128>
instead ofu128
. So I am holding changes if this is not desired.