Commit 126f2a1
rename Amount::saturating_div into saturating_ratio (#4972)
## Motivation
The `Amount` can be multiplied by `u128` using `saturating_mul` but we
don't have an inverse operation. The existing `saturating_div` compute a
`u128` ratio between two amounts.
## Proposal
* rename `Amount::saturating_div` into `saturating_ratio`
* create a new `Amount::saturating_div` that takes a u128 similar to
`saturating_mul`
## Test Plan
CI
## Release Plan
- These changes should be backported to the latest `testnet` branch,
then
- be released in a new SDK,
---------
Signed-off-by: Mathieu Baudet <[email protected]>
Co-authored-by: Andreas Fackler <[email protected]>1 parent a92cfc0 commit 126f2a1
2 files changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
466 | 471 | | |
467 | 472 | | |
468 | 473 | | |
| |||
727 | 732 | | |
728 | 733 | | |
729 | 734 | | |
730 | | - | |
| 735 | + | |
731 | 736 | | |
732 | 737 | | |
733 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| |||
0 commit comments