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. |
||
---|---|---|
.. | ||
data | ||
api.rs | ||
serde.rs | ||
str.rs |