rust-bitcoin-unsafe-fast/units/tests
Andrew Poelstra cb882c5ce1
units: add global `BlockMtpInterval` type
See the previous commit message for justification; for sensible
arithmetic on block timestamps we need the ability to do MTP
calculations on arbitrary MTPs and arbitrary intervals between them.
However, the absolute::Mtp and relative::MtpInterval types are severely
limited in both range and precision.

Also adds a bunch of arithmetic ops to match the existing ops for
BlockHeight and BlockInterval. These panic on overflow, just like the
underlying std arithmetic, which I think is reasonable behavior for
types which are documented as being thin wrappers around u32.

We may want to add checked_add, checked_sub and maybe checked_sum
methods, but that's out of scope for this PR.
2025-05-06 15:19:36 +00:00
..
data units: Add serde regression test 2024-12-28 08:15:13 +11:00
api.rs units: add global `BlockMtpInterval` type 2025-05-06 15:19:36 +00:00
serde.rs units: rename absolute::Time to absolute::Mtp 2025-05-02 17:44:58 +00:00
str.rs 2025-05-04 automated rustfmt nightly 2025-05-04 01:41:13 +00:00