rust-bitcoin-unsafe-fast/bitcoin
Tobin C. Harding d174c06a4a
Saturate to_fee to Amount::MAX
The `FeeRate::checked_mul_by_weight` function currently returns a
`NumOpResult` but all other `checked_` functions return an `Option`.
This is surprising and adds no additional information.

Change `checked_mul_by_weight` to return `None` on overflow. But in
`to_fee` saturate to `Amount::MAX` because doing so makes a few APIs
better without any risk since a fee must be checked anyway so
`Amount::MAX` as a fee is equally descriptive in the error case.

This leads to removing the `NumOpResult` from `effective_value` also.

Note that sadly we remove the very nice docs on `NumOpResult::map`
because they no longer work.

Fix: #4497
2025-05-31 07:52:00 +01:00
..
contrib Remove rust-ordered dependency 2025-02-18 13:36:07 +11:00
embedded chore: remove unused cortex-m dependency from embedded Cargo.toml files in bitcoin and hashes modules. 2025-04-05 18:25:41 +08:00
examples Finalize the script hex APIs 2025-05-08 15:12:05 +10:00
src Saturate to_fee to Amount::MAX 2025-05-31 07:52:00 +01:00
tests 2025-05-25 automated rustfmt nightly 2025-05-25 01:42:57 +00:00
CHANGELOG.md BREAKING: Change Psbt serde implementations 2025-05-22 16:41:05 -05:00
Cargo.toml BREAKING: Change Psbt serde implementations 2025-05-22 16:41:05 -05:00