test: round difficulty and networkhashps #32725

pull Sjors wants to merge 1 commits into bitcoin:master from Sjors:2025/06/getmininginfo-precision changing 1 files +7 −8
  1. Sjors commented at 9:40 am on June 11, 2025: member

    Both are rational numbers. Client software should only use them to display information to humans. Followup calculations should use the underlying values such as target.

    Therefore it’s not necessary to test the handling of these floating point values. Round them down to avoid spurious test failures.

    Fixes #32515

  2. test: round difficulty and networkhashps
    Both are rational numbers. Client software should only use them to
    display information to humans. Followup calculations should use the
    underlying values such as target.
    
    Therefore it's not necessary to test the handling of these floating
    point values. Round them down to avoid spurious test failures.
    
    Fixes #32515
    578ea3eedb
  3. DrahtBot commented at 9:40 am on June 11, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32725.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK w0xlt, janb84

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on Jun 11, 2025
  5. Sjors commented at 9:44 am on June 11, 2025: member
    Note that mining_mainnet.py uses integer difficulty values (1 and 4) so it shouldn’t have this issue.
  6. w0xlt commented at 5:38 pm on June 11, 2025: contributor
  7. janb84 commented at 12:31 pm on June 12, 2025: contributor

    ACK 578ea3eedb285519762087a4b27d953d8f61667f

    • Code review ✅
    • compiled & tested ✅

    The PR changes test to use a more reasonable rounded difficulty and networkhashps to remove false positives in testing.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-06-15 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me