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.
test: Add generatetodescriptor RPC #16943
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:1909-rpcMiningDescriptor changing 4 files +50 −3-
MarcoFalke commented at 6:20 PM on September 23, 2019: member
-
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.
- DrahtBot added the label Mining on Sep 23, 2019
- DrahtBot added the label RPC/REST/ZMQ on Sep 23, 2019
- DrahtBot added the label Tests on Sep 23, 2019
- MarcoFalke force-pushed on Sep 23, 2019
-
instagibbs commented at 6:53 PM on September 23, 2019: member
concept ACK
-
DrahtBot commented at 8:02 PM on September 23, 2019: member
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
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.
-
promag commented at 9:31 PM on September 23, 2019: member
Concept ACK.
-
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.
-
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.
fjahr commented at 7:58 PM on September 26, 2019: membertested ACK Ran tests and also did some manual testing.
MarcoFalke force-pushed on Sep 26, 2019in 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:generatetoaddressisn't hidden, so I used the same. Otherwise it would also be missing from the gui-autocomplete.laanwj added this to the milestone 0.20.0 on Oct 1, 2019MarcoFalke removed this from the milestone 0.20.0 on Oct 18, 2019rpc: Add generatetodescriptor fa144e6fdeMarcoFalke force-pushed on Oct 30, 2019MarcoFalke commented at 2:03 PM on October 30, 2019: memberRebased for
CHECK_NONFATALlaanwj commented at 2:12 PM on October 30, 2019: memberACK fa144e6fde1f546a952023af715032cb6789d948
laanwj referenced this in commit cab94cc074 on Oct 30, 2019laanwj merged this on Oct 30, 2019laanwj closed this on Oct 30, 2019MarcoFalke deleted the branch on Oct 30, 2019jasonbcox referenced this in commit 08a28259cd on Oct 19, 2020MarcoFalke locked this on Dec 16, 2021ContributorsLabels
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-05-02 12:14 UTC
More mirrored repositories can be found on mirror.b10c.me