aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/testdata/reqresp-echo.js
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/testdata/reqresp-echo.js')
-rw-r--r--rpc/testdata/reqresp-echo.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/rpc/testdata/reqresp-echo.js b/rpc/testdata/reqresp-echo.js
new file mode 100644
index 000000000..7a9e90321
--- /dev/null
+++ b/rpc/testdata/reqresp-echo.js
@@ -0,0 +1,16 @@
+// This test calls the test_echo method.
+
+--> {"jsonrpc": "2.0", "id": 2, "method": "test_echo", "params": []}
+<-- {"jsonrpc":"2.0","id":2,"error":{"code":-32602,"message":"missing value for required argument 0"}}
+
+--> {"jsonrpc": "2.0", "id": 2, "method": "test_echo", "params": ["x"]}
+<-- {"jsonrpc":"2.0","id":2,"error":{"code":-32602,"message":"missing value for required argument 1"}}
+
+--> {"jsonrpc": "2.0", "id": 2, "method": "test_echo", "params": ["x", 3]}
+<-- {"jsonrpc":"2.0","id":2,"result":{"String":"x","Int":3,"Args":null}}
+
+--> {"jsonrpc": "2.0", "id": 2, "method": "test_echo", "params": ["x", 3, {"S": "foo"}]}
+<-- {"jsonrpc":"2.0","id":2,"result":{"String":"x","Int":3,"Args":{"S":"foo"}}}
+
+--> {"jsonrpc": "2.0", "id": 2, "method": "test_echoWithCtx", "params": ["x", 3, {"S": "foo"}]}
+<-- {"jsonrpc":"2.0","id":2,"result":{"String":"x","Int":3,"Args":{"S":"foo"}}}