diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-25 20:55:24 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-01-05 11:30:20 +0100 |
commit | 286ec08cb0e5611bb062bc45d4b86df6d6ea801f (patch) | |
tree | 2178e03dca5a1e6c0b468cc1a7488cacfae5cdb1 /src/rpc | |
parent | 495eb44a4f8461c799d2b1ad70e54d087a0b3098 (diff) |
rpc: Add 'echo' call for testing
This hidden call simply returns what is passed in.
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/misc.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index f7c4ecc20c..13befb1089 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -492,6 +492,17 @@ UniValue getmemoryinfo(const JSONRPCRequest& request) return obj; } +UniValue echo(const JSONRPCRequest& request) +{ + if (request.fHelp) + throw runtime_error( + "echo \"message\" ...\n" + "\nSimply echo back the input arguments\n" + ); + + return request.params; +} + static const CRPCCommand commands[] = { // category name actor (function) okSafeMode // --------------------- ------------------------ ----------------------- ---------- @@ -504,6 +515,7 @@ static const CRPCCommand commands[] = /* Not shown in help */ { "hidden", "setmocktime", &setmocktime, true }, + { "hidden", "echo", &echo, true, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}}, }; void RegisterMiscRPCCommands(CRPCTable &t) |