Update some RPC examples from legacy to bech32.
Fixes #18185.
Update some RPC examples from legacy to bech32.
Fixes #18185.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
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.
1222 | @@ -1223,7 +1223,7 @@ static UniValue listreceivedbyaddress(const JSONRPCRequest& request) 1223 | HelpExampleCli("listreceivedbyaddress", "") 1224 | + HelpExampleCli("listreceivedbyaddress", "6 true") 1225 | + HelpExampleRpc("listreceivedbyaddress", "6, true, true") 1226 | - + HelpExampleRpc("listreceivedbyaddress", "6, true, true, \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\"") 1227 | + + HelpExampleRpc("listreceivedbyaddress", "6, true, true, " + EXAMPLE_ADDRESS + "")
The extra + "" isn't necessary.
Thanks for dropping that. Can you squash these two commits?
@Sjors Done!
re-ACK de83a30e7b7244e7cd7f9df7ad829aa96e479f3f
Code-Review ACK https://github.com/bitcoin/bitcoin/commit/de83a30e7b7244e7cd7f9df7ad829aa96e479f3f, changes LGTM
Note though that this PR alone does not completely fix #18185 yet (which is fine as the PR title only says "some RPCExamples" and not all), as there are still some other RPCExamples containing legacy addresses:
sendmanyaddmultisigaddresslistunspentSince those examples contain more than one address, it will probably make sense to add another constant for a second bech32 (invalid) address. I think it's okay to do all that in an extra follow-up PR.
@theStack Yes, actually i wasn't sure about adding another constant for a different address and EXAMPLE_ADDRESS isn't looks suitable for some examples because there is extra \ (back slash) before the " (quote) at the end of these addresses, that's why i left some of these examples:

And i think we can put these different example addresses to in a const array and use them like EXAMPLE_ADDRESS[0] and EXAMPLE_ADDRESS[1].
@yusufsahinhamza: Oh, thanks for pointing the backslash problem out -- considering that, it was not very wise from my side to include the quote characters in the EXAMPLE_ADDRESS string in https://github.com/bitcoin/bitcoin/commit/7f1475c7119e8c72bce39a63386a6ca859066b80 :thinking: I'd suggest then to remove the quotes from the constant and set the surrounding characters directly in the RPCExamples (not here, but in the course of a follow-up PR).
And i think we can put these different example addresses to in a const array and use them like EXAMPLE_ADDRESS[0] and EXAMPLE_ADDRESS[1].
Agreed.
@yusufsahinhamza: It was not my intention that this PR gets closed, I think it would have been fine to merge it, since it already had two ACKs. Just because it doesn't fully fixes #18185 doesn't mean it's bad. With "follow-up PR" I meant a PR that is based on one that was already merged :-)
@theStack Oh okay, i thought we will continue in the new PR, no problem.
Given that you have already written the new pull and that all the lines touched here will be touched again in the other pull, it seems easier and less work for reviewers to just focus on that one. I'd suggest closing this one again.