Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bddap authored and yeastplume committed Apr 24, 2019
1 parent 47ee03c commit bff07eb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ failure_derive = "0.1"
log = "0.4"
uuid = { version = "0.7", features = ["serde", "v4"] }
serde_json = "1"
easy-jsonrpc = "0.4.1"
easy-jsonrpc = "0.5.1"
chrono = { version = "0.4.4", features = ["serde"] }

grin_wallet_libwallet = { path = "../libwallet", version = "1.1.0-beta.2" }
Expand Down
2 changes: 1 addition & 1 deletion api/src/foreign_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ pub fn run_doctest_foreign(
let mut api_foreign = Foreign::new(wallet1.clone());
api_foreign.doctest_mode = true;
let foreign_api = &api_foreign as &dyn ForeignRpc;
Ok(foreign_api.handle_request(request))
Ok(foreign_api.handle_request(request).as_option())
}

#[doc(hidden)]
Expand Down
2 changes: 1 addition & 1 deletion api/src/owner_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ pub fn run_doctest_owner(
let mut api_owner = Owner::new(wallet1.clone());
api_owner.doctest_mode = true;
let owner_api = &api_owner as &dyn OwnerRpc;
Ok(owner_api.handle_request(request))
Ok(owner_api.handle_request(request).as_option())
}

#[doc(hidden)]
Expand Down
2 changes: 1 addition & 1 deletion controller/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tokio-retry = "0.1"
uuid = { version = "0.7", features = ["serde", "v4"] }
url = "1.7.0"
chrono = { version = "0.4.4", features = ["serde"] }
easy-jsonrpc = "0.4.1"
easy-jsonrpc = "0.5.1"
lazy_static = "1"

grin_wallet_util = { path = "../util", version = "1.1.0-beta.2" }
Expand Down
20 changes: 11 additions & 9 deletions controller/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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!([]))
}
}
}))
Expand Down Expand Up @@ -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!([]))
}
}
}))
Expand Down

0 comments on commit bff07eb

Please sign in to comment.