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

rust-bitcoin / rust-bitcoin / 12663898767
83%

Build:
DEFAULT BRANCH: master
Ran 08 Jan 2025 04:11AM UTC
Jobs 1
Files 116
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

08 Jan 2025 04:08AM UTC coverage: 82.994% (+0.01%) from 82.98%
12663898767

push

github

apoelstra
Merge rust-bitcoin/rust-bitcoin#3839: Use `_unchecked` to construct amounts

<a class=hub.com/rust-bitcoin/rust-bitcoin/commit/a7c44cebf9975c4eeba56a65c0ea65be90e5c7f3">a7c44cebf<a href="https://github.com/rust-bitcoin/rust-bitcoin/commit/515a66b8540447211dcbc9e42134c37a4977261b"> Use _unchecked to construct amounts (Tobin C. Harding)
<a class="double-link" href="https://github.com/rust-bitcoin/rust-bitcoin/commit/09df951760e02bdcc488616d3f924046c6d28e85">09df95176</a><a href="https://github.com/rust-bitcoin/rust-bitcoin/commit/515a66b8540447211dcbc9e42134c37a4977261b"> Use sat variable in tests (Tobin C. Harding)
</a><a class="double-link" href="https://github.com/rust-bitcoin/rust-bitcoin/commit/4a5b2c60c6dc40905d3081d291536a6cff473813">4a5b2c60c</a> Use ssat variable in tests (Tobin C. Harding)

Pull request description:

  We have a `_unchecked` constructor now for both `Amount` and `SignedAmount`. Soon we would like to start enforcing the `MAX_MONEY` invariant in both amount types. To make that change easier do a few refactorings:

  - Patch 1 and 2 introduce local variables for amount constructors.
  - Patch 3 replaces the local variables introduce in  (1) and (2) with macros
  - Patch 4 uses `_unchecked` constructor for hard coded integers

  The strange patch separation is done intentionally so we don't inadvertently reduce test coverage by using the wrong constructor. I made this mistake already in a previous PR, lesson learned.

  Note please, the macro introduced in patch 3 is in preparation for enforcing `MAX_MONEY`. The macros allow us to panic (`from_sat().unwrap()`) instead of using the `_unchecked` version.

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

Tree-SHA512: 55c2428ae58f4bec261a96855fa7ee18667

123 of 123 new or added lines in 5 files covered. (100.0%)

20721 of 24967 relevant lines covered (82.99%)

17424.19 hits per line

Jobs
ID Job ID Ran Files Coverage
1 12663898767.1 08 Jan 2025 04:11AM UTC 0
82.99
GitHub Action Run
Source Files on build 12663898767
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #12663898767
  • 515a66b8 on github
  • Prev Build on master (#12662004205)
  • Next Build on master (#12677285488)
  • 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