• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rust-bitcoin / rust-bitcoin / 13846653850
83%

Build:
DEFAULT BRANCH: master
Ran 13 Mar 2025 11:36PM UTC
Jobs 1
Files 126
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Mar 2025 11:35PM UTC coverage: 83.129% (-0.04%) from 83.173%
13846653850

push

github

apoelstra
Merge rust-bitcoin/rust-bitcoin#4157: Enforce MAX_MONEY invariant in amount types

<a class=hub.com/rust-bitcoin/rust-bitcoin/commit/ab4ea7c13d08411044bd5f9c17457e926c80ed4d">ab4ea7c13 Enforce the MAX_MONEY invariant in amount types (Tobin C. Harding)

Pull request description:

  Enforcing the `MAX_MONEY` invariant is quite involved because it means multiple things:

  - Constructing amounts is now fallible
  - Converting from unsigned to signed is now infallible
  - Taking the absolute value is now infallible
  - Integer overflow is eliminated in various places

  Details:
  - Update `from_sat` to check the invariant
  - Fix all docs including examples
  - Use the unchecked constructor in test code
  - Comment any other use of the unchecked constructor
  - Deprecate `unchecked_abs`
  - Fail serde (using the horrible string error variant)
  - Try not to use the unchecked constructor in rustdocs, no need to encourage unsuspecting users to use it.
  - Use `?` in rustdoc examples (required by Rust API guidlines)
  - Remove `TryFrom<Amount> for SignedAmount` because the conversion is now infallible. Add a `From` impl.
  - Fix the arbitrary impls
  - Maintain correct formatting
  - Remove private `check_max` function as its no longer needed

  Close #620

ACKs for top commit:
  apoelstra:
    ACK ab4ea7c13d08411044bd5f9c17457e926c80ed4d; successfully ran local tests

Tree-SHA512: bec963d8e3d376c2d20862ef6f0ca312afb

85 of 103 new or added lines in 10 files covered. (82.52%)

13 existing lines in 3 files now uncovered.

21788 of 26210 relevant lines covered (83.13%)

16832.95 hits per line

Uncovered Changes

Lines Coverage ∆ File
9
80.0
-1.82% units/src/amount/signed.rs
7
83.33
-2.96% units/src/amount/unsigned.rs
1
94.74
-5.26% bitcoin/src/lib.rs
1
88.71
-2.27% units/src/fee.rs

Coverage Regressions

Lines Coverage ∆ File
6
80.0
-1.82% units/src/amount/signed.rs
4
83.33
-2.96% units/src/amount/unsigned.rs
3
88.71
-2.27% units/src/fee.rs
Jobs
ID Job ID Ran Files Coverage
1 13846653850.1 13 Mar 2025 11:36PM UTC 126
83.13
GitHub Action Run
Source Files on build 13846653850
  • Tree
  • List 126
  • Changed 11
  • Source Changed 11
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #13846653850
  • 0ca9fcfd on github
  • Prev Build on master (#13843194225)
  • Next Build on master (#13887044200)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc