rpc: Validate provided keys for query_options parameter in listunspent #19169

pull PastaPastaPasta wants to merge 1 commits into bitcoin:master from PastaPastaPasta:bitcoin-validate-keys-listunspent changing 1 files +9 −0
  1. PastaPastaPasta commented at 9:36 PM on June 4, 2020: contributor

    At Dash, one of our developers was working with the listunspent RPC command, but instead of saying "minimumAmount" he said "minimmumAmount" as such the RPC wasn't working as expected.

    In https://github.com/dashpay/dash/pull/3507 we implemented a check so that listunspent returns an error if an unrecognized option is given. I figured I might as well adapt the code and throw up a PR here.

    Cheers!

  2. DrahtBot added the label RPC/REST/ZMQ on Jun 4, 2020
  3. DrahtBot added the label Wallet on Jun 4, 2020
  4. luke-jr changes_requested
  5. luke-jr commented at 5:16 PM on June 5, 2020: member

    Can you refactor this to use RPCTypeCheckObj?

  6. PastaPastaPasta force-pushed on Jun 5, 2020
  7. PastaPastaPasta commented at 6:41 PM on June 5, 2020: contributor

    I like that, makes it simpler, changed, and squashed/force-pushed

  8. PastaPastaPasta commented at 6:42 PM on June 5, 2020: contributor

    Tested with

    generatetoaddress 105 bcrt1qwq0cnj557dn070dd8l52dhkathpx083qlg5v4w
    listunspent 1 99999999 [] true "{\"minimumAmount\" : 49}"
    listunspent 1 99999999 [] true "{\"minimumAmount\" : 51}"
    listunspent 1 99999999 [] true "{\"minimumAAmount\" : 51}"
    

    Everything worked as expected

  9. rpc: Validate provided keys for query_options parameter in listunspent
    With this change listunspent will throw an error if there is a wrong key
    in the query_option object.
    
    Signed-off-by: pasta <pasta@dashboost.org>
    a99a3c0bd6
  10. PastaPastaPasta force-pushed on Jun 5, 2020
  11. PastaPastaPasta commented at 8:05 PM on June 5, 2020: contributor

    Resolved test failure. made amounts not have their type checked since that gets checked anyway in AmountFromValue

  12. luke-jr referenced this in commit 3010f7631b on Jun 9, 2020
  13. adaminsky commented at 5:27 AM on August 5, 2020: contributor

    ACK a99a3c0bd Built, ran unit tests and functional tests, and manually tested RPCs with different query_options objects including unsupported parameters. Reviewed the code and it looks good.

  14. meshcollider commented at 9:32 PM on August 13, 2020: contributor

    Seems fine to me. utACK a99a3c0bd6d5476503c015e23be569295fdd190c

  15. fanquake commented at 7:07 AM on August 14, 2020: member

    @MarcoFalke can you take a look here?

  16. MarcoFalke commented at 6:17 PM on August 27, 2020: member

    RPCman will do this in the future, but nothing wrong adding something like that in the meantime

  17. MarcoFalke merged this on Aug 27, 2020
  18. MarcoFalke closed this on Aug 27, 2020

  19. sidhujag referenced this in commit 213346e9e7 on Aug 28, 2020
  20. PastaPastaPasta deleted the branch on Sep 11, 2021
  21. Fabcien referenced this in commit 7d31c1813b on Sep 16, 2021
  22. DrahtBot locked this on Oct 30, 2022

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-13 15:14 UTC

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