Update jsonrpc dependencies and rewrite dapps to futures. (#6522)
* Bump version. * Fix RPC crate. * Fix BoxFuture in crates. * Compiles and passes tests! * Get rid of .boxed() * Fixing issues with the UI. * Remove minihttp. Support threads. * Reimplement files serving to do it in chunks. * Increase chunk size. * Remove some unecessary copying. * Fix tests. * Fix stratum warning and ipfs todo. * Switch to proper branch of jsonrpc. * Update Cargo.lock. * Update docs. * Include dapps-glue in workspace. * fixed merge artifacts * Fix test compilation.
This commit is contained in:
committed by
Arkadiy Paronyan
parent
492da38d67
commit
e8b418ca03
@@ -1,5 +1,3 @@
|
||||
extern crate jsonrpc_core;
|
||||
|
||||
use std::fmt::{Debug, Formatter, Error as FmtError};
|
||||
use std::io::{BufReader, BufRead};
|
||||
use std::sync::Arc;
|
||||
@@ -33,9 +31,9 @@ use serde_json::{
|
||||
Error as JsonError,
|
||||
};
|
||||
|
||||
use futures::{BoxFuture, Canceled, Complete, Future, oneshot, done};
|
||||
use futures::{Canceled, Complete, Future, oneshot, done};
|
||||
|
||||
use jsonrpc_core::{Id, Version, Params, Error as JsonRpcError};
|
||||
use jsonrpc_core::{BoxFuture, Id, Version, Params, Error as JsonRpcError};
|
||||
use jsonrpc_core::request::MethodCall;
|
||||
use jsonrpc_core::response::{Output, Success, Failure};
|
||||
|
||||
@@ -212,7 +210,7 @@ impl Rpc {
|
||||
) -> BoxFuture<Result<Self, RpcError>, Canceled> {
|
||||
let (c, p) = oneshot::<Result<Self, RpcError>>();
|
||||
match get_authcode(authpath) {
|
||||
Err(e) => return done(Ok(Err(e))).boxed(),
|
||||
Err(e) => return Box::new(done(Ok(Err(e)))),
|
||||
Ok(code) => {
|
||||
let url = String::from(url);
|
||||
// The ws::connect takes a FnMut closure, which means c cannot
|
||||
@@ -239,7 +237,7 @@ impl Rpc {
|
||||
_ => ()
|
||||
}
|
||||
});
|
||||
p.boxed()
|
||||
Box::new(p)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,7 +264,7 @@ impl Rpc {
|
||||
.expect("request is serializable");
|
||||
let _ = self.out.send(serialized);
|
||||
|
||||
p.map(|result| {
|
||||
Box::new(p.map(|result| {
|
||||
match result {
|
||||
Ok(json) => {
|
||||
let t: T = json::from_value(json)?;
|
||||
@@ -274,7 +272,7 @@ impl Rpc {
|
||||
},
|
||||
Err(err) => Err(err)
|
||||
}
|
||||
}).boxed()
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
pub mod client;
|
||||
pub mod signer_client;
|
||||
|
||||
extern crate ethcore_util as util;
|
||||
extern crate futures;
|
||||
extern crate jsonrpc_core;
|
||||
extern crate jsonrpc_ws_server as ws;
|
||||
extern crate parity_rpc as rpc;
|
||||
extern crate parking_lot;
|
||||
extern crate rand;
|
||||
extern crate serde;
|
||||
extern crate serde_json;
|
||||
extern crate tempdir;
|
||||
extern crate url;
|
||||
extern crate hash;
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ use rpc::signer::{ConfirmationRequest, TransactionModification, U256, Transactio
|
||||
use serde;
|
||||
use serde_json::{Value as JsonValue, to_value};
|
||||
use std::path::PathBuf;
|
||||
use futures::{BoxFuture, Canceled};
|
||||
use futures::{Canceled};
|
||||
use jsonrpc_core::BoxFuture;
|
||||
|
||||
pub struct SignerRpc {
|
||||
rpc: Rpc,
|
||||
|
||||
Reference in New Issue
Block a user