diff --git a/bin/tau/taud/src/rpc_add.rs b/bin/tau/taud/src/rpc_add.rs index 8138c2424..2dbcbabcc 100644 --- a/bin/tau/taud/src/rpc_add.rs +++ b/bin/tau/taud/src/rpc_add.rs @@ -4,11 +4,7 @@ use serde_json::{json, Value}; use darkfi::{util::Timestamp, Error}; -use crate::{ - error::{TaudError, TaudResult}, - task_info::TaskInfo, - JsonRpcInterface, -}; +use crate::{error::TaudResult, task_info::TaskInfo, JsonRpcInterface}; #[derive(Clone, Debug, Serialize, Deserialize)] struct BaseTaskInfo { @@ -38,11 +34,6 @@ impl JsonRpcInterface { // <-- {"jsonrpc": "2.0", "result": true, "id": 1} pub async fn add(&self, params: Value) -> TaudResult { debug!(target: "tau", "JsonRpc::add() params {}", params); - - if !params.is_array() { - return Err(TaudError::InvalidData("params is not an array".into())) - } - let args = params.as_array().unwrap(); let task: BaseTaskInfo = serde_json::from_value(args[0].clone())?; diff --git a/bin/tau/taud/src/rpc_get.rs b/bin/tau/taud/src/rpc_get.rs index d3b4527cd..4922464ac 100644 --- a/bin/tau/taud/src/rpc_get.rs +++ b/bin/tau/taud/src/rpc_get.rs @@ -26,11 +26,6 @@ impl JsonRpcInterface { // <-- {"jsonrpc": "2.0", "result": "task", "id": 1} pub async fn get_task_by_id(&self, params: Value) -> TaudResult { debug!(target: "tau", "JsonRpc::get_task_by_id() params {}", params); - - if !params.is_array() { - return Err(TaudError::InvalidData("params is not an array".into())) - } - let args = params.as_array().unwrap(); if args.len() != 1 { diff --git a/bin/tau/taud/src/rpc_update.rs b/bin/tau/taud/src/rpc_update.rs index 05577ba85..2e78aef86 100644 --- a/bin/tau/taud/src/rpc_update.rs +++ b/bin/tau/taud/src/rpc_update.rs @@ -16,11 +16,6 @@ impl JsonRpcInterface { // <-- {"jsonrpc": "2.0", "result": true, "id": 1} pub async fn update(&self, params: Value) -> TaudResult { debug!(target: "tau", "JsonRpc::update() params {}", params); - - if !params.is_array() { - return Err(TaudError::InvalidData("params is not an array".into())) - } - let args = params.as_array().unwrap(); if args.len() != 2 { @@ -42,11 +37,6 @@ impl JsonRpcInterface { // TODO: BUG: Validate that the state string is correct and not something arbitrary debug!(target: "tau", "JsonRpc::set_state() params {}", params); - - if !params.is_array() { - return Err(TaudError::InvalidData("params is not an array".into())) - } - let args = params.as_array().unwrap(); if args.len() != 2 { @@ -69,11 +59,6 @@ impl JsonRpcInterface { // <-- {"jsonrpc": "2.0", "result": true, "id": 1} pub async fn set_comment(&self, params: Value) -> TaudResult { debug!(target: "tau", "JsonRpc::set_comment() params {}", params); - - if !params.is_array() { - return Err(TaudError::InvalidData("params is not an array".into())) - } - let args = params.as_array().unwrap(); if args.len() != 2 {