test: Add generatetodescriptor RPC #16943

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:1909-rpcMiningDescriptor changing 4 files +50 −3
  1. MarcoFalke commented at 6:20 pm on September 23, 2019: member
    The existing generatetoaddress RPC can only generate to scriptPubKeys that can be represented by an address. However, raw scripts (such as OP_TRUE) or P2PK can not be represented by an address, which complicates testing.
  2. MarcoFalke commented at 6:22 pm on September 23, 2019: member
    This has also been requested by @harding (https://twitter.com/hrdng/status/1101924904990056448). And everyone who liked that tweet, obviously.
  3. DrahtBot added the label Mining on Sep 23, 2019
  4. DrahtBot added the label RPC/REST/ZMQ on Sep 23, 2019
  5. DrahtBot added the label Tests on Sep 23, 2019
  6. MarcoFalke force-pushed on Sep 23, 2019
  7. instagibbs commented at 6:53 pm on September 23, 2019: member
    concept ACK
  8. DrahtBot commented at 8:02 pm on September 23, 2019: member

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #16365 (Log RPC parameters (arguments) if -debug=rpcparams by LarryRuane)

    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.

  9. promag commented at 9:31 pm on September 23, 2019: member
    Concept ACK.
  10. laanwj commented at 8:35 am on September 25, 2019: member
    I’m a bit ambivalent about extending the internal miner after so much effort over time to reduce it or even get rid of it. But if this helps testing, sure, concept ACK.
  11. in src/rpc/mining.cpp:167 in fa64e2d67c outdated
    162+    const int num_blocks{request.params[0].get_int()};
    163+    const int64_t max_tries{request.params[2].isNull() ? 1000000 : request.params[2].get_int()};
    164+
    165+    FlatSigningProvider key_provider;
    166+    std::string error;
    167+    const auto desc = Parse(request.params[1].get_str(), key_provider, error, /* require_checksum = */ true);
    


    fjahr commented at 7:56 pm on September 26, 2019:
    Since this is for testing, the checksum could not be required so that people have the choice to use it or not. But I don’t feel strongly about it.

    MarcoFalke commented at 8:14 pm on September 26, 2019:
    Good point. I reached the same conclusion, but didn’t get to change it yet.
  12. fjahr commented at 7:58 pm on September 26, 2019: member
    tested ACK Ran tests and also did some manual testing.
  13. MarcoFalke force-pushed on Sep 26, 2019
  14. in src/rpc/mining.cpp:1007 in fada0098c2 outdated
    1003@@ -961,6 +1004,7 @@ static const CRPCCommand commands[] =
    1004 
    1005 
    1006     { "generating",         "generatetoaddress",      &generatetoaddress,      {"nblocks","address","maxtries"} },
    1007+    { "generating",         "generatetodescriptor",   &generatetodescriptor,   {"num_blocks","descriptor","maxtries"} },
    


    laanwj commented at 7:58 am on September 30, 2019:
    As it is test-only, it should probably be hidden from the normal help.

    MarcoFalke commented at 6:54 pm on October 2, 2019:
    generatetoaddress isn’t hidden, so I used the same. Otherwise it would also be missing from the gui-autocomplete.
  15. laanwj added this to the milestone 0.20.0 on Oct 1, 2019
  16. MarcoFalke removed this from the milestone 0.20.0 on Oct 18, 2019
  17. laanwj commented at 11:15 am on October 30, 2019: member
    Needs update after #17192, I guess.
  18. rpc: Add generatetodescriptor fa144e6fde
  19. MarcoFalke force-pushed on Oct 30, 2019
  20. MarcoFalke commented at 2:03 pm on October 30, 2019: member
    Rebased for CHECK_NONFATAL
  21. laanwj commented at 2:12 pm on October 30, 2019: member
    ACK fa144e6fde1f546a952023af715032cb6789d948
  22. laanwj referenced this in commit cab94cc074 on Oct 30, 2019
  23. laanwj merged this on Oct 30, 2019
  24. laanwj closed this on Oct 30, 2019

  25. MarcoFalke deleted the branch on Oct 30, 2019
  26. jasonbcox referenced this in commit 08a28259cd on Oct 19, 2020
  27. MarcoFalke locked this on Dec 16, 2021

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: 2024-12-21 15:12 UTC

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