Skip to content

Commit bbb0936

Browse files
committed
Move HelpExample* from rpcwallet to rpcserver
General functions used throughout the RPC framework don't belong in rpcwallet.
1 parent 00cfc9f commit bbb0936

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/rpcserver.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,4 +820,13 @@ json_spirit::Value CRPCTable::execute(const std::string &strMethod, const json_s
820820
}
821821
}
822822

823+
std::string HelpExampleCli(string methodname, string args){
824+
return "> bitcoin-cli " + methodname + " " + args + "\n";
825+
}
826+
827+
std::string HelpExampleRpc(string methodname, string args){
828+
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
829+
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
830+
}
831+
823832
const CRPCTable tableRPC;

src/rpcwallet.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ std::string HelpRequiringPassphrase()
3333
: "";
3434
}
3535

36-
std::string HelpExampleCli(string methodname, string args){
37-
return "> bitcoin-cli " + methodname + " " + args + "\n";
38-
}
39-
40-
std::string HelpExampleRpc(string methodname, string args){
41-
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
42-
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
43-
}
44-
4536
void EnsureWalletIsUnlocked()
4637
{
4738
if (pwalletMain->IsLocked())

0 commit comments

Comments
 (0)