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

@@ -57,6 +57,17 @@ impl EventLoop {
}
}
/// Returns this event loop raw remote.
///
/// Deprecated: Exists only to connect with current JSONRPC implementation.
pub fn raw_remote(&self) -> TokioRemote {
if let Mode::Tokio(ref remote) = self.remote.inner {
remote.clone()
} else {
panic!("Event loop is never initialized in other mode then Tokio.")
}
}
/// Returns event loop remote.
pub fn remote(&self) -> Remote {
self.remote.clone()
@@ -76,6 +87,15 @@ pub struct Remote {
}
impl Remote {
/// Remote for existing event loop.
///
/// Deprecated: Exists only to connect with current JSONRPC implementation.
pub fn new(remote: TokioRemote) -> Self {
Remote {
inner: Mode::Tokio(remote),
}
}
/// Synchronous remote, used mostly for tests.
pub fn new_sync() -> Self {
Remote {