Skip to content

Add property-based tests for BitcoinUnit conversions#507

Merged
gcomte merged 1 commit intomasterfrom
fix/add-property-based-tests
Mar 30, 2026
Merged

Add property-based tests for BitcoinUnit conversions#507
gcomte merged 1 commit intomasterfrom
fix/add-property-based-tests

Conversation

@gcomte
Copy link
Copy Markdown
Owner

@gcomte gcomte commented Mar 30, 2026

Summary

  • Add proptest dev dependency and 4 property-based tests for BitcoinUnit
  • Tests verify: roundtrip conversion preserves values (within f64 precision), btc_value() is always positive, order is preserved across unit conversions, and round_value() respects decimal_places()
  • Derive Clone on BitcoinUnit (required by proptest's Just)

Uses proptest to verify: roundtrip conversion preserves values,
btc_value is always positive, order is preserved across unit
conversions, and round_value respects decimal_places.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Warning

Rate limit exceeded

@gcomte has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 33 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 21 minutes and 33 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9e8fe0a1-cdaf-43cf-a0e9-9fc3db5a3ce8

📥 Commits

Reviewing files that changed from the base of the PR and between 0fc0ae0 and c01efc4.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • src/currency/btc.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-property-based-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gcomte gcomte merged commit a33d7ed into master Mar 30, 2026
7 checks passed
@gcomte gcomte deleted the fix/add-property-based-tests branch March 30, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant