rpc: Allow params as JSON object

This commit is contained in:
parazyd
2023-11-01 19:48:47 +01:00
parent ff6f7acb85
commit 235626b31d
9 changed files with 26 additions and 30 deletions

View File

@@ -104,13 +104,13 @@ fn jsonrpc_reqrep() -> Result<()> {
msleep(500).await;
let client = RpcClient::new(endpoint, executor.clone()).await?;
let req = JsonRequest::new("ping", vec![]);
let req = JsonRequest::new("ping", vec![].into());
let rep = client.request(req).await?;
let rep = String::try_from(rep).unwrap();
assert_eq!(&rep, "pong");
let req = JsonRequest::new("kill", vec![]);
let req = JsonRequest::new("kill", vec![].into());
let rep = client.request(req).await?;
let rep = String::try_from(rep).unwrap();