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. |
||
---|---|---|
.. | ||
contrib | ||
src | ||
tests | ||
CHANGELOG.md | ||
Cargo.toml | ||
README.md |
README.md
Bitcoin Units
This crate provides basic Bitcoin numeric units such as Amount
.
Minimum Supported Rust Version (MSRV)
This library should always compile with any combination of features on Rust 1.63.0.
Licensing
The code in this project is licensed under the Creative Commons CC0 1.0 Universal license. We use the SPDX license list and SPDX IDs.