Test: batch rpc with params #19936

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:batch_param changing 1 files +1 −1
  1. instagibbs commented at 7:31 PM on September 10, 2020: member

    Useful as an example and test case.

  2. DrahtBot added the label Tests on Sep 10, 2020
  3. in test/functional/interface_rpc.py:48 in 00822b9379 outdated
      44 | @@ -45,7 +45,7 @@ def test_batch_request(self):
      45 |              # work fine.
      46 |              {"method": "invalidmethod", "id": 2},
      47 |              # Another call that should succeed.
      48 | -            {"method": "getbestblockhash", "id": 3},
      49 | +            {"method": "getblockhash", "id": 3, "params": [self.nodes[0].getblockcount()]},
    


    laanwj commented at 12:39 PM on September 11, 2020:

    Concept ACK on testing a call with parameters. Though, you're calling into the RPC while building the query, which is a bit funny (but not a problem in practice as there is a well-defiend execution order).


    instagibbs commented at 7:50 PM on September 11, 2020:

    doesn't reflect practical usage sure, but was a quick way to demonstrate how it's done, and exercise it :)

    I was looking for an example and tests are the first place I look!


    promag commented at 4:07 PM on September 13, 2020:

    Could just use "params": [0].


    instagibbs commented at 5:44 PM on September 13, 2020:

    fair enough that's easy to understand, done

  4. promag commented at 4:08 PM on September 13, 2020: member

    ACK

  5. Test batch rpc with params e1fdd2963b
  6. instagibbs force-pushed on Sep 13, 2020
  7. theStack approved
  8. theStack commented at 9:38 PM on September 15, 2020: member

    ACK e1fdd2963baab68bb6a77af2ad7a07fcacd4e73e

  9. laanwj commented at 2:23 PM on September 16, 2020: member

    ACK e1fdd2963baab68bb6a77af2ad7a07fcacd4e73e

  10. laanwj merged this on Sep 16, 2020
  11. laanwj closed this on Sep 16, 2020

  12. sidhujag referenced this in commit 9a5235168b on Sep 16, 2020
  13. PastaPastaPasta referenced this in commit 19ce3d34f0 on Sep 17, 2021
  14. PastaPastaPasta referenced this in commit 016e8c0bab on Sep 24, 2021
  15. Fabcien referenced this in commit fd6a2c2754 on Oct 5, 2021
  16. kittywhiskers referenced this in commit 9d48e0c37b on Oct 12, 2021
  17. DrahtBot locked this on Feb 15, 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-27 03:14 UTC

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