taud: Add TODOs.

This commit is contained in:
parazyd
2022-05-22 12:02:46 +02:00
parent f2fe803812
commit 61ce0bd91d

View File

@@ -36,6 +36,8 @@ struct BaseTaskInfo {
rank: Option<f32>,
}
// TODO: Make more like RPC in darkfid, this implies the method categories,
// and function signatures, and safety checks.
#[async_trait]
impl RequestHandler for JsonRpcInterface {
async fn handle_request(&self, req: JsonRequest) -> JsonResult {
@@ -145,6 +147,8 @@ impl JsonRpcInterface {
// --> {"jsonrpc": "2.0", "method": "set_state", "params": [task_id, state], "id": 1}
// <-- {"jsonrpc": "2.0", "result": true, "id": 1}
async fn set_state(&self, params: Value) -> TaudResult<Value> {
// TODO: BUG: Validate that the state string is correct and not something arbitrary
debug!(target: "tau", "JsonRpc::set_state() params {}", params);
let args = params.as_array().unwrap();