New jsonrpc-core with futures and metadata support (#3859)

* Bumping serde & serde_json

* Super-initial usage of new jsonrpc

* Single event loop for jsonrpc

* Metadata

* Supporting metadata extraction for eth_accounts

* Fixing Cargo.lock

* Removing uneccessary clones

* Fixing unused import

* Unused import

* Fixing test
This commit is contained in:
Tomasz Drwięga
2017-01-11 20:02:27 +01:00
committed by Gav Wood
parent c4d96a64a2
commit 41da1a0a79
45 changed files with 706 additions and 642 deletions

View File

@@ -47,8 +47,10 @@ pub trait Fetch: Clone + Send + Sync + 'static {
/// Spawn the future in context of this `Fetch` thread pool.
/// Implementation is optional.
fn process<F>(&self, f: F) -> BoxFuture<(), ()> where
F: Future<Item=(), Error=()> + Send + 'static,
fn process<F, I, E>(&self, f: F) -> BoxFuture<I, E> where
F: Future<Item=I, Error=E> + Send + 'static,
I: Send + 'static,
E: Send + 'static,
{
f.boxed()
}
@@ -99,8 +101,10 @@ impl Fetch for Client {
Self::with_limit(Some(50*1024*1024))
}
fn process<F>(&self, f: F) -> BoxFuture<(), ()> where
F: Future<Item=(), Error=()> + Send + 'static,
fn process<F, I, E>(&self, f: F) -> BoxFuture<I, E> where
F: Future<Item=I, Error=E> + Send + 'static,
I: Send + 'static,
E: Send + 'static,
{
self.pool.spawn(f).boxed()
}