Skip to content

Add from sat unchecked and checked to signed#3698

Closed
yancyribbens wants to merge 2 commits intorust-bitcoin:masterfrom
yancyribbens:add-from-sat-unchecked-and-checked-to-signed
Closed

Add from sat unchecked and checked to signed#3698
yancyribbens wants to merge 2 commits intorust-bitcoin:masterfrom
yancyribbens:add-from-sat-unchecked-and-checked-to-signed

Conversation

@yancyribbens
Copy link
Copy Markdown
Contributor

This PR adds from_sat_unchecked to SignedAmount and changes the type signature of from_sat to return an Option. This segways into #3691 where the next commit would change MAX to MAX_MONEY. Since SignedAmount is used less, it's also a simple way to prototype this change before applying the larger change to Amount.

@github-actions github-actions bot added the C-units PRs modifying the units crate label Dec 6, 2024
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 6, 2024

Pull Request Test Coverage Report for Build 12214743895

Details

  • 49 of 53 (92.45%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 82.872%

Changes Missing Coverage Covered Lines Changed/Added Lines %
units/src/amount/signed.rs 10 14 71.43%
Totals Coverage Status
Change from base Build 12188753888: -0.002%
Covered Lines: 20201
Relevant Lines: 24376

💛 - Coveralls

@yancyribbens yancyribbens force-pushed the add-from-sat-unchecked-and-checked-to-signed branch 4 times, most recently from fd79c8b to 6a2a8c6 Compare December 6, 2024 19:43
Replaced by function the panics when value is greater than MAX.
Adds a new signature which return Option and a function body that checks
for cases where MAX is exceeded.
@yancyribbens yancyribbens force-pushed the add-from-sat-unchecked-and-checked-to-signed branch from 6a2a8c6 to e1c693d Compare December 7, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-units PRs modifying the units crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants