rust-bitcoin-unsafe-fast/units/src
Jamil Lambert, PhD 6950c0a7b5
Change `Amount::MAX` to equal `MAX_MONEY`
To prevent rounding errors converting to and from f64 change
`Amount::MAX` to `MAX_MONEY` which is below the limit in f64 that has
issues.

Add checks to `from_str_in`, `checked_add` and `checked_mul` that the
result is below MAX, where previously a u64 overflow was relied on.

Change tests to account for new lower MAX that is within the range of
SignedAmount and does not overflow so easily

Remove overflow tests

`Amount::MAX` is now below `u64::MAX` and within the range of values for
`SignedAmount`.   These tests therefore do not overflow.
In effective_value there is no error with `Amount::MAX` and the correct
value is returned.
In psbt the removed test is effectively the same as the previous test.

Modify `Amount` tests to work with new `MAX`

Tests need to be changed that checked values above the new `MAX` or
`Amount::MAX` was out of range for `SignedAmount` which it isn't anymore
2024-12-04 14:17:00 +00:00
..
amount Change `Amount::MAX` to equal `MAX_MONEY` 2024-12-04 14:17:00 +00:00
locktime Standardize wording to `constructs a new` 2024-11-05 13:02:26 +00:00
block.rs Implement iter::Sum for BlockInterval 2024-11-28 15:56:07 +11:00
fee_rate.rs Implement iter::Sum for FeeRate 2024-11-28 15:49:01 +11:00
lib.rs Merge rust-bitcoin/rust-bitcoin#3539: Improve the `amount` module 2024-11-04 23:32:41 +00:00
parse.rs 2024-12-01 automated rustfmt nightly 2024-12-01 01:41:12 +00:00
weight.rs 2024-11-17 automated rustfmt nightly 2024-11-17 01:23:55 +00:00