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:
Tomasz Drwięga
2017-10-05 12:35:01 +02:00
committed by Arkadiy Paronyan
parent 492da38d67
commit e8b418ca03
118 changed files with 2090 additions and 2908 deletions

View File

@@ -11,7 +11,6 @@ ethcore-bigint = { path = "../util/bigint" }
ethcore-network = { path = "../util/network" }
ethcrypto = { path = "../ethcrypto" }
ethkey = { path = "../ethkey" }
futures = "0.1"
hex = "0.2"
log = "0.3"
ordered-float = "0.5"
@@ -27,6 +26,6 @@ smallvec = "0.4"
time = "0.1"
tiny-keccak = "1.3"
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.7" }
jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.7" }
jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.7" }
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.8" }
jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.8" }
jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.8" }

View File

@@ -22,7 +22,6 @@ extern crate ethcore_bigint as bigint;
extern crate ethcore_network as network;
extern crate ethcrypto;
extern crate ethkey;
extern crate futures;
extern crate hex;
extern crate ordered_float;
extern crate parking_lot;
@@ -30,7 +29,6 @@ extern crate rand;
extern crate rlp;
extern crate ring;
extern crate serde;
extern crate serde_json;
extern crate slab;
extern crate smallvec;
extern crate time;
@@ -51,6 +49,9 @@ extern crate jsonrpc_macros;
#[macro_use]
extern crate serde_derive;
#[cfg(test)]
extern crate serde_json;
pub use self::message::Message;
pub use self::net::{Network, MessageHandler};

View File

@@ -28,7 +28,6 @@ use jsonrpc_pubsub::{Session, PubSubMetadata, SubscriptionId};
use jsonrpc_macros::pubsub;
use bigint::hash::H256;
use futures::{future, BoxFuture};
use parking_lot::RwLock;
use self::filter::Filter;
@@ -140,7 +139,7 @@ build_rpc_trait! {
/// Unsubscribe from filter matching given ID. Return
/// true on success, error otherwise.
#[rpc(name = "shh_unsubscribe")]
fn unsubscribe(&self, SubscriptionId) -> BoxFuture<bool, Error>;
fn unsubscribe(&self, SubscriptionId) -> Result<bool, Error>;
}
}
}
@@ -377,7 +376,7 @@ impl<P: PoolHandle + 'static, M: Send + Sync + PubSubMetadata> WhisperPubSub for
}
}
fn unsubscribe(&self, id: SubscriptionId) -> BoxFuture<bool, Error> {
fn unsubscribe(&self, id: SubscriptionId) -> Result<bool, Error> {
use std::str::FromStr;
let res = match id {
@@ -387,6 +386,6 @@ impl<P: PoolHandle + 'static, M: Send + Sync + PubSubMetadata> WhisperPubSub for
SubscriptionId::Number(_) => Err("unrecognized ID"),
};
Box::new(future::done(res.map_err(whisper_error)))
res.map_err(whisper_error)
}
}