Test checkunparsable errors #35834

pull Herb-ops wants to merge 2 commits into bitcoin:master from Herb-ops:test-checkunparsable-errors changing 1 files +18 −12
  1. Herb-ops commented at 12:44 PM on July 29, 2026: none

    CheckUnparsable parses both a private-form descriptor and its corresponding public-form descriptor. The helper previously reused one error string for both parses.

    The public parse therefore overwrote the private parse’s error. Although the helper verified that both parses failed, its exact error assertion only checked the error produced by the public parse. An incorrect private-form error could consequently go undetected.

    Changes

    • Store the private and public parse errors separately.
    • Check the exact private error when a private-form descriptor is provided.
    • Continue checking the exact public error.
    • Add an overload that accepts different expected private and public errors.
    • Preserve the existing three-argument interface for cases where both errors should match.
    • Update the affected test cases with their existing private-form errors.

    This also corrects a raw descriptor test whose private input used raw(...) while its public input mistakenly used sh(...). Both inputs now use raw(...), with Raw script is not hex as the expected error.

    This PR only changes test code and does not affect production descriptor parsing.

  2. test: Fix public descriptor in raw() unparsable test f49f433352
  3. test: Check private errors in CheckUnparsable 3e1d0ee5e3
  4. DrahtBot commented at 12:44 PM on July 29, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35445 (wallet, descriptor: Revert StringType::COMPAT for Miniscript expressions and drop the concept of a Descriptor ID that can be validated by achow101)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

Contributors

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: 2026-07-31 20:50 UTC

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