Merge bitcoin/bitcoin#23714: doc: Normalize RPC description whitespace

faa0833c43 doc: Normalize RPC description whitespace (MarcoFalke)

Pull request description:

  It is tedious to manually add trailing newlines after the description so that there is an empty new line before the `Arguments` section.

  Fix that by adding it with C++ code.

ACKs for top commit:
  fanquake:
    ACK faa0833c43

Tree-SHA512: 061786c7f19d767f2b7a0362b948e34d181f4cc740a60211756da29ece7554e95be39a9beec3e201eddc8da3ea7e22ac917479eae04b230bb7b0db7a9647af8c
This commit is contained in:
fanquake 2021-12-09 15:47:52 +08:00
commit c4ae714f55
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
3 changed files with 4 additions and 5 deletions

View File

@ -301,7 +301,7 @@ static RPCHelpMan deriveaddresses()
static RPCHelpMan verifymessage()
{
return RPCHelpMan{"verifymessage",
"\nVerify a signed message\n",
"Verify a signed message.",
{
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address to use for the signature."},
{"signature", RPCArg::Type::STR, RPCArg::Optional::NO, "The signature provided by the signer in base 64 encoding (see signmessage)."},

View File

@ -620,10 +620,9 @@ std::string RPCHelpMan::ToString() const
ret += arg.ToString(/* oneline */ true);
}
if (was_optional) ret += " )";
ret += "\n";
// Description
ret += m_description;
ret += "\n\n" + TrimString(m_description) + "\n";
// Arguments
Sections sections;

View File

@ -17,9 +17,9 @@ class RPCGenerateTest(BitcoinTestFramework):
def run_test(self):
message = (
"generate\n"
"generate\n\n"
"has been replaced by the -generate "
"cli option. Refer to -help for more information."
"cli option. Refer to -help for more information.\n"
)
self.log.info("Test rpc generate raises with message to use cli option")