diff --git a/jsonrpc/src/main.rs b/jsonrpc/src/main.rs index e5b33d9f..da0f1db2 100644 --- a/jsonrpc/src/main.rs +++ b/jsonrpc/src/main.rs @@ -4,7 +4,7 @@ use std::sync::{Arc, RwLock}; use std::time::Duration; use actix_rt::time::delay_for; -use actix_web::{middleware, web, App, Error, HttpRequest, HttpResponse, HttpServer}; +use actix_web::{middleware, web, App, Error, HttpResponse, HttpServer}; use bytes::Bytes; use futures::{Future, FutureExt}; use serde_json; @@ -14,7 +14,10 @@ use serde_json::Value; mod convention; /// The main handler for JSONRPC server. -async fn rpc_handler(req: HttpRequest, body: Bytes) -> Result { +async fn rpc_handler( + body: Bytes, + app_state: web::Data, +) -> Result { let reqjson: convention::Request = match serde_json::from_slice(body.as_ref()) { Ok(ok) => ok, Err(_) => { @@ -29,7 +32,6 @@ async fn rpc_handler(req: HttpRequest, body: Bytes) -> Result