DRAFT: Checking for multi/single-value types in UniValue. #27994

pull Brotcrunsher wants to merge 1 commits into bitcoin:master from Brotcrunsher:UniValueCheckType changing 2 files +24 −3
  1. Brotcrunsher commented at 5:26 PM on June 28, 2023: contributor

    Previously it was possible to call getValStr() on a VOBJ and VARR, which silently resulted in the return of an empty string. However, such a call would be most likely a bug. We are now throwing in case of such types.

    Similarly, calling empty() and size() didn't make sense for none VOBJ/VARR UniValues.

    Please note: This is a draft and not meant to be merged just yet. I created the pull request already because I wanted to see what the CI-Pipeline tells me about this. I also want to give this change another code read pass to convince myself that these changes are actually okay in every case they are currently used.

  2. DrahtBot commented at 5:26 PM on June 28, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

  3. Brotcrunsher force-pushed on Jun 28, 2023
  4. DrahtBot added the label CI failed on Jun 28, 2023
  5. Brotcrunsher marked this as a draft on Jun 28, 2023
  6. Checking for multi/single-value types in UniValue.
    Previously it was possible to call getValStr() on a VOBJ and VARR, which silently resulted in the return of an empty string. However, such a call would be most likely a bug. We are now throwing in case of such types.
    
    Similarly, calling empty() and size() didn't make sense for none VOBJ/VARR UniValues.
    a1a54033a4
  7. Brotcrunsher force-pushed on Jun 28, 2023
  8. DrahtBot removed the label CI failed on Jun 28, 2023
  9. Brotcrunsher commented at 7:18 PM on July 5, 2023: contributor

    Closing. Although this might be valid, I currently lack the time to check this in detail. If I find the time to properly check it all, I might reopen it.

  10. Brotcrunsher closed this on Jul 5, 2023

  11. bitcoin locked this on Jul 4, 2024

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-04-26 06:13 UTC

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