Skip to content

Commit

Permalink
rpc: add help for enumeratesigners and walletdisplayaddress
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjors committed Apr 8, 2021
1 parent b0db187 commit 88d4d5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions src/rpc/external_signer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

static RPCHelpMan enumeratesigners()
{
return RPCHelpMan{
"enumeratesigners",
return RPCHelpMan{"enumeratesigners",
"Returns a list of external signers from -signer.",
{},
RPCResult{
Expand All @@ -28,8 +27,12 @@ static RPCHelpMan enumeratesigners()
}
}
},
RPCExamples{""},
[](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue {
RPCExamples{
HelpExampleCli("enumeratesigners", "")
+ HelpExampleRpc("enumeratesigners", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
const std::string command = gArgs.GetArg("-signer", "");
if (command == "") throw JSONRPCError(RPC_MISC_ERROR, "Error: restart bitcoind with -signer=<cmd>");
std::string chain = gArgs.GetChainName();
Expand Down
8 changes: 4 additions & 4 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4529,9 +4529,8 @@ static RPCHelpMan upgradewallet()
#ifdef ENABLE_EXTERNAL_SIGNER
static RPCHelpMan walletdisplayaddress()
{
return RPCHelpMan{
"walletdisplayaddress",
"Display address on an external signer for verification.\n",
return RPCHelpMan{"walletdisplayaddress",
"Display address on an external signer for verification.",
{
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, /* default_val */ "", "bitcoin address to display"},
},
Expand All @@ -4542,7 +4541,8 @@ static RPCHelpMan walletdisplayaddress()
}
},
RPCExamples{""},
[](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue {
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get();
Expand Down

0 comments on commit 88d4d5f

Please sign in to comment.