This commit is contained in:
Andrew Dirksen
2019-04-24 01:26:52 -07:00
committed by Yeastplume
parent 47ee03cadd
commit bff07eb3f5
6 changed files with 22 additions and 20 deletions
+11 -9
View File
@@ -44,7 +44,7 @@ use uuid::Uuid;
use crate::apiwallet::{Foreign, ForeignRpc, Owner, OwnerRpc};
use easy_jsonrpc;
use easy_jsonrpc::Handler;
use easy_jsonrpc::{Handler, MaybeReply};
lazy_static! {
pub static ref GRIN_OWNER_BASIC_REALM: HeaderValue =
@@ -687,10 +687,11 @@ where
Box::new(parse_body(req).and_then(move |val: serde_json::Value| {
let owner_api = &api as &dyn OwnerRpc;
match owner_api.handle_request(val) {
Some(r) => ok(r),
None => {
error!("OwnerAPI: call_api: failed with error");
err(ErrorKind::GenericError(format!("OwnerAPI Call Failed")).into())
MaybeReply::Reply(r) => ok(r),
MaybeReply::DontReply => {
// Since it's http, we need to return something. We return [] because jsonrpc
// clients will parse it as an empty batch response.
ok(serde_json::json!([]))
}
}
}))
@@ -866,10 +867,11 @@ where
Box::new(parse_body(req).and_then(move |val: serde_json::Value| {
let foreign_api = &api as &dyn ForeignRpc;
match foreign_api.handle_request(val) {
Some(r) => ok(r),
None => {
error!("ForeignAPI: call_api: failed with error");
err(ErrorKind::GenericError(format!("ForeignAPI Call Failed")).into())
MaybeReply::Reply(r) => ok(r),
MaybeReply::DontReply => {
// Since it's http, we need to return something. We return [] because jsonrpc
// clients will parse it as an empty batch response.
ok(serde_json::json!([]))
}
}
}))