diff --git a/.travis.yml b/.travis.yml index 7a8b94ec9..d0848d222 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,9 +32,6 @@ before_script: script: - cargo build --all - cargo test --all - - cargo test --manifest-path=core-client/Cargo.toml --features "http" - - cargo test --manifest-path=core-client/Cargo.toml --features "http, tls" - - cargo test --manifest-path=core-client/Cargo.toml --features "ws" - | ([ $TRAVIS_RUST_VERSION = stable ] && cargo fmt --all -- --check) || true diff --git a/Cargo.toml b/Cargo.toml index 9509ac35d..b509827d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ members = [ "core", "core-client", + "core-client/transports", "http", "ipc", "derive", diff --git a/_automate/publish.sh b/_automate/publish.sh index ca6b15ae4..9b0dbfe9e 100755 --- a/_automate/publish.sh +++ b/_automate/publish.sh @@ -2,11 +2,20 @@ set -exu -ORDER=(core core-client server-utils tcp ws ws/client http ipc stdio pubsub derive test) +VERSION=$(grep "^version" ./core/Cargo.toml | sed -e 's/.*"\(.*\)"/\1/') +ORDER=(core core-client/transports core-client server-utils tcp ws ws/client http ipc stdio pubsub derive test) + +echo "Publishing version $VERSION" +cargo clean for crate in ${ORDER[@]}; do cd $crate + echo "Publishing $crate@$VERSION" + sleep 5 cargo publish $@ cd - done +echo "Tagging version $VERSION" +git tag -a v$VERSION -m "Version $VERSION" +git push --tags diff --git a/core-client/Cargo.toml b/core-client/Cargo.toml index e4a2e3d5f..82fb8247a 100644 --- a/core-client/Cargo.toml +++ b/core-client/Cargo.toml @@ -8,7 +8,7 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"] license = "MIT" name = "jsonrpc-core-client" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" categories = [ "asynchronous", @@ -19,31 +19,12 @@ categories = [ ] [features] -tls = ["hyper-tls"] -http = ["hyper"] -ws = [ - "websocket", - "tokio", -] +tls = ["jsonrpc-client-transports/tls"] +http = ["jsonrpc-client-transports/http"] +ws = ["jsonrpc-client-transports/ws"] [dependencies] -failure = "0.1" -futures = "0.1.26" -hyper = { version = "0.12", optional = true } -hyper-tls = { version = "0.3.2", optional = true } -jsonrpc-core = { version = "11.0", path = "../core" } -log = "0.4" -serde = "1.0" -serde_json = "1.0" -tokio = { version = "0.1", optional = true } -websocket = { version = "0.22", optional = true } - -[dev-dependencies] -assert_matches = "1.1" -jsonrpc-http-server = { version = "11.0", path = "../http" } -lazy_static = "1.0" -env_logger = "0.6" -tokio = "0.1" +jsonrpc-client-transports = { version = "12.0", path = "./transports", default-features = false } [badges] travis-ci = { repository = "paritytech/jsonrpc", branch = "master"} diff --git a/core-client/src/lib.rs b/core-client/src/lib.rs index 43982e28d..818716ee8 100644 --- a/core-client/src/lib.rs +++ b/core-client/src/lib.rs @@ -1,217 +1,8 @@ -//! JSON-RPC client implementation. -#![deny(missing_docs)] - -use failure::{format_err, Fail}; -use futures::sync::{mpsc, oneshot}; -use futures::{future, prelude::*}; -use jsonrpc_core::{Error, Params}; -use serde::de::DeserializeOwned; -use serde::Serialize; -use serde_json::Value; - -pub mod transports; - -#[cfg(test)] -mod logger; - -/// The errors returned by the client. -#[derive(Debug, Fail)] -pub enum RpcError { - /// An error returned by the server. - #[fail(display = "Server returned rpc error {}", _0)] - JsonRpcError(Error), - /// Failure to parse server response. - #[fail(display = "Failed to parse server response as {}: {}", _0, _1)] - ParseError(String, failure::Error), - /// Request timed out. - #[fail(display = "Request timed out")] - Timeout, - /// The server returned a response with an unknown id. - #[fail(display = "Server returned a response with an unknown id")] - UnknownId, - /// Not rpc specific errors. - #[fail(display = "{}", _0)] - Other(failure::Error), -} - -impl From for RpcError { - fn from(error: Error) -> Self { - RpcError::JsonRpcError(error) - } -} - -/// A message sent to the `RpcClient`. This is public so that -/// the derive crate can generate a client. -struct RpcMessage { - /// The rpc method name. - method: String, - /// The rpc method parameters. - params: Params, - /// The oneshot channel to send the result of the rpc - /// call to. - sender: oneshot::Sender>, -} - -/// A channel to a `RpcClient`. -#[derive(Clone)] -pub struct RpcChannel(mpsc::Sender); - -impl RpcChannel { - fn send( - &self, - msg: RpcMessage, - ) -> impl Future, Error = mpsc::SendError> { - self.0.to_owned().send(msg) - } -} - -impl From> for RpcChannel { - fn from(sender: mpsc::Sender) -> Self { - RpcChannel(sender) - } -} - -/// The future returned by the rpc call. -pub struct RpcFuture { - recv: oneshot::Receiver>, -} - -impl RpcFuture { - /// Creates a new `RpcFuture`. - pub fn new(recv: oneshot::Receiver>) -> Self { - RpcFuture { recv } - } -} - -impl Future for RpcFuture { - type Item = Value; - type Error = RpcError; - - fn poll(&mut self) -> Result, Self::Error> { - // TODO should timeout (#410) - match self.recv.poll() { - Ok(Async::Ready(Ok(value))) => Ok(Async::Ready(value)), - Ok(Async::Ready(Err(error))) => Err(error), - Ok(Async::NotReady) => Ok(Async::NotReady), - Err(error) => Err(RpcError::Other(error.into())), - } - } -} - -/// Client for raw JSON RPC requests -#[derive(Clone)] -pub struct RawClient(RpcChannel); - -impl From for RawClient { - fn from(channel: RpcChannel) -> Self { - RawClient(channel) - } -} - -impl RawClient { - /// Call RPC with raw JSON - pub fn call_method(&self, method: &str, params: Params) -> impl Future { - let (sender, receiver) = oneshot::channel(); - let msg = RpcMessage { - method: method.into(), - params, - sender, - }; - self.0 - .send(msg) - .map_err(|error| RpcError::Other(error.into())) - .and_then(|_| RpcFuture::new(receiver)) - } -} - -/// Client for typed JSON RPC requests -#[derive(Clone)] -pub struct TypedClient(RawClient); - -impl From for TypedClient { - fn from(channel: RpcChannel) -> Self { - TypedClient(channel.into()) - } -} - -impl TypedClient { - /// Create new TypedClient - pub fn new(raw_cli: RawClient) -> Self { - TypedClient(raw_cli) - } - - /// Call RPC with serialization of request and deserialization of response - pub fn call_method( - &self, - method: &str, - returns: &'static str, - args: T, - ) -> impl Future { - let args = - serde_json::to_value(args).expect("Only types with infallible serialisation can be used for JSON-RPC"); - let params = match args { - Value::Array(vec) => Params::Array(vec), - Value::Null => Params::None, - _ => { - return future::Either::A(future::err(RpcError::Other(format_err!( - "RPC params should serialize to a JSON array, or null" - )))) - } - }; - - future::Either::B(self.0.call_method(method, params).and_then(move |value: Value| { - log::debug!("response: {:?}", value); - let result = - serde_json::from_value::(value).map_err(|error| RpcError::ParseError(returns.into(), error.into())); - future::done(result) - })) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::transports::local; - use crate::{RpcChannel, RpcError, TypedClient}; - use jsonrpc_core::{self, IoHandler}; - - #[derive(Clone)] - struct AddClient(TypedClient); - - impl From for AddClient { - fn from(channel: RpcChannel) -> Self { - AddClient(channel.into()) - } - } - - impl AddClient { - fn add(&self, a: u64, b: u64) -> impl Future { - self.0.call_method("add", "u64", (a, b)) - } - } - - #[test] - fn test_client_terminates() { - let mut handler = IoHandler::new(); - handler.add_method("add", |params: Params| { - let (a, b) = params.parse::<(u64, u64)>()?; - let res = a + b; - Ok(jsonrpc_core::to_value(res).unwrap()) - }); - - let (client, rpc_client) = local::connect::(handler); - let fut = client - .clone() - .add(3, 4) - .and_then(move |res| client.add(res, 5)) - .join(rpc_client) - .map(|(res, ())| { - assert_eq!(res, 12); - }) - .map_err(|err| { - eprintln!("{:?}", err); - assert!(false); - }); - tokio::run(fut); - } -} +//! JSON-RPC client implementation primitives. +//! +//! By default this crate does not implement any transports, +//! use corresponding features (`tls`, `http` or `ws`) to opt-in for them. +//! +//! See documentation of [`jsonrpc-client-transports`](../jsonrpc_client_transports/) for more details. + +pub use jsonrpc_client_transports::*; diff --git a/core-client/transports/Cargo.toml b/core-client/transports/Cargo.toml new file mode 100644 index 000000000..ea60c1e7e --- /dev/null +++ b/core-client/transports/Cargo.toml @@ -0,0 +1,50 @@ +[package] +authors = ["Parity Technologies "] +description = "Transport agnostic JSON-RPC 2.0 client implementation." +documentation = "https://docs.rs/jsonrpc-client-transports/" +edition = "2018" +homepage = "https://github.com/paritytech/jsonrpc" +keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"] +license = "MIT" +name = "jsonrpc-client-transports" +repository = "https://github.com/paritytech/jsonrpc" +version = "12.0.0" + +categories = [ + "asynchronous", + "network-programming", + "web-programming::http-client", + "web-programming::http-server", + "web-programming::websocket", +] + +[features] +default = ["http", "tls", "ws"] +tls = ["hyper-tls", "http"] +http = ["hyper"] +ws = [ + "websocket", + "tokio", +] + +[dependencies] +failure = "0.1" +futures = "0.1.26" +hyper = { version = "0.12", optional = true } +hyper-tls = { version = "0.3.2", optional = true } +jsonrpc-core = { version = "12.0", path = "../../core" } +log = "0.4" +serde = "1.0" +serde_json = "1.0" +tokio = { version = "0.1", optional = true } +websocket = { version = "0.22", optional = true } + +[dev-dependencies] +assert_matches = "1.1" +jsonrpc-http-server = { version = "12.0", path = "../../http" } +lazy_static = "1.0" +env_logger = "0.6" +tokio = "0.1" + +[badges] +travis-ci = { repository = "paritytech/jsonrpc", branch = "master"} diff --git a/core-client/transports/src/lib.rs b/core-client/transports/src/lib.rs new file mode 100644 index 000000000..ba7dab823 --- /dev/null +++ b/core-client/transports/src/lib.rs @@ -0,0 +1,218 @@ +//! JSON-RPC client implementation. + +#![deny(missing_docs)] + +use failure::{format_err, Fail}; +use futures::sync::{mpsc, oneshot}; +use futures::{future, prelude::*}; +use jsonrpc_core::{Error, Params}; +use serde::de::DeserializeOwned; +use serde::Serialize; +use serde_json::Value; + +pub mod transports; + +#[cfg(test)] +mod logger; + +/// The errors returned by the client. +#[derive(Debug, Fail)] +pub enum RpcError { + /// An error returned by the server. + #[fail(display = "Server returned rpc error {}", _0)] + JsonRpcError(Error), + /// Failure to parse server response. + #[fail(display = "Failed to parse server response as {}: {}", _0, _1)] + ParseError(String, failure::Error), + /// Request timed out. + #[fail(display = "Request timed out")] + Timeout, + /// The server returned a response with an unknown id. + #[fail(display = "Server returned a response with an unknown id")] + UnknownId, + /// Not rpc specific errors. + #[fail(display = "{}", _0)] + Other(failure::Error), +} + +impl From for RpcError { + fn from(error: Error) -> Self { + RpcError::JsonRpcError(error) + } +} + +/// A message sent to the `RpcClient`. This is public so that +/// the derive crate can generate a client. +struct RpcMessage { + /// The rpc method name. + method: String, + /// The rpc method parameters. + params: Params, + /// The oneshot channel to send the result of the rpc + /// call to. + sender: oneshot::Sender>, +} + +/// A channel to a `RpcClient`. +#[derive(Clone)] +pub struct RpcChannel(mpsc::Sender); + +impl RpcChannel { + fn send( + &self, + msg: RpcMessage, + ) -> impl Future, Error = mpsc::SendError> { + self.0.to_owned().send(msg) + } +} + +impl From> for RpcChannel { + fn from(sender: mpsc::Sender) -> Self { + RpcChannel(sender) + } +} + +/// The future returned by the rpc call. +pub struct RpcFuture { + recv: oneshot::Receiver>, +} + +impl RpcFuture { + /// Creates a new `RpcFuture`. + pub fn new(recv: oneshot::Receiver>) -> Self { + RpcFuture { recv } + } +} + +impl Future for RpcFuture { + type Item = Value; + type Error = RpcError; + + fn poll(&mut self) -> Result, Self::Error> { + // TODO should timeout (#410) + match self.recv.poll() { + Ok(Async::Ready(Ok(value))) => Ok(Async::Ready(value)), + Ok(Async::Ready(Err(error))) => Err(error), + Ok(Async::NotReady) => Ok(Async::NotReady), + Err(error) => Err(RpcError::Other(error.into())), + } + } +} + +/// Client for raw JSON RPC requests +#[derive(Clone)] +pub struct RawClient(RpcChannel); + +impl From for RawClient { + fn from(channel: RpcChannel) -> Self { + RawClient(channel) + } +} + +impl RawClient { + /// Call RPC with raw JSON + pub fn call_method(&self, method: &str, params: Params) -> impl Future { + let (sender, receiver) = oneshot::channel(); + let msg = RpcMessage { + method: method.into(), + params, + sender, + }; + self.0 + .send(msg) + .map_err(|error| RpcError::Other(error.into())) + .and_then(|_| RpcFuture::new(receiver)) + } +} + +/// Client for typed JSON RPC requests +#[derive(Clone)] +pub struct TypedClient(RawClient); + +impl From for TypedClient { + fn from(channel: RpcChannel) -> Self { + TypedClient(channel.into()) + } +} + +impl TypedClient { + /// Create new TypedClient + pub fn new(raw_cli: RawClient) -> Self { + TypedClient(raw_cli) + } + + /// Call RPC with serialization of request and deserialization of response + pub fn call_method( + &self, + method: &str, + returns: &'static str, + args: T, + ) -> impl Future { + let args = + serde_json::to_value(args).expect("Only types with infallible serialisation can be used for JSON-RPC"); + let params = match args { + Value::Array(vec) => Params::Array(vec), + Value::Null => Params::None, + _ => { + return future::Either::A(future::err(RpcError::Other(format_err!( + "RPC params should serialize to a JSON array, or null" + )))) + } + }; + + future::Either::B(self.0.call_method(method, params).and_then(move |value: Value| { + log::debug!("response: {:?}", value); + let result = + serde_json::from_value::(value).map_err(|error| RpcError::ParseError(returns.into(), error.into())); + future::done(result) + })) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::transports::local; + use crate::{RpcChannel, RpcError, TypedClient}; + use jsonrpc_core::{self, IoHandler}; + + #[derive(Clone)] + struct AddClient(TypedClient); + + impl From for AddClient { + fn from(channel: RpcChannel) -> Self { + AddClient(channel.into()) + } + } + + impl AddClient { + fn add(&self, a: u64, b: u64) -> impl Future { + self.0.call_method("add", "u64", (a, b)) + } + } + + #[test] + fn test_client_terminates() { + let mut handler = IoHandler::new(); + handler.add_method("add", |params: Params| { + let (a, b) = params.parse::<(u64, u64)>()?; + let res = a + b; + Ok(jsonrpc_core::to_value(res).unwrap()) + }); + + let (client, rpc_client) = local::connect::(handler); + let fut = client + .clone() + .add(3, 4) + .and_then(move |res| client.add(res, 5)) + .join(rpc_client) + .map(|(res, ())| { + assert_eq!(res, 12); + }) + .map_err(|err| { + eprintln!("{:?}", err); + assert!(false); + }); + tokio::run(fut); + } +} diff --git a/core-client/src/logger.rs b/core-client/transports/src/logger.rs similarity index 100% rename from core-client/src/logger.rs rename to core-client/transports/src/logger.rs diff --git a/core-client/src/transports/duplex.rs b/core-client/transports/src/transports/duplex.rs similarity index 100% rename from core-client/src/transports/duplex.rs rename to core-client/transports/src/transports/duplex.rs diff --git a/core-client/src/transports/http.rs b/core-client/transports/src/transports/http.rs similarity index 96% rename from core-client/src/transports/http.rs rename to core-client/transports/src/transports/http.rs index 464a8bf23..180e5a990 100644 --- a/core-client/src/transports/http.rs +++ b/core-client/transports/src/transports/http.rs @@ -16,7 +16,7 @@ use futures::{ use hyper::{http, rt, Client, Request, Uri}; /// Create a HTTP Client -pub fn http(url: &str) -> impl Future +pub fn connect(url: &str) -> impl Future where TClient: From, { @@ -192,7 +192,7 @@ mod tests { let (tx, rx) = std::sync::mpsc::channel(); // when - let run = http(&server.uri) + let run = connect(&server.uri) .and_then(|client: TestClient| { client.hello("http").and_then(move |result| { drop(client); @@ -217,7 +217,7 @@ mod tests { let invalid_uri = "invalid uri"; // when - let run = http(invalid_uri); // rx.recv_timeout(Duration::from_secs(3)).unwrap(); + let run = connect(invalid_uri); // rx.recv_timeout(Duration::from_secs(3)).unwrap(); let res: Result = run.wait(); // then @@ -237,7 +237,7 @@ mod tests { let (tx, rx) = std::sync::mpsc::channel(); // when - let run = http(&server.uri) + let run = connect(&server.uri) .and_then(|client: TestClient| { client.fail().then(move |res| { let _ = tx.send(res); @@ -272,7 +272,7 @@ mod tests { server.stop(); let (tx, rx) = std::sync::mpsc::channel(); - let client = http(&server.uri); + let client = connect(&server.uri); let call = client .and_then(|client: TestClient| { @@ -311,7 +311,7 @@ mod tests { let (tx, rx) = std::sync::mpsc::channel(); let tx2 = tx.clone(); - let client = http(&server.uri); + let client = connect(&server.uri); let call = client .and_then(move |client: TestClient| { diff --git a/core-client/src/transports/local.rs b/core-client/transports/src/transports/local.rs similarity index 100% rename from core-client/src/transports/local.rs rename to core-client/transports/src/transports/local.rs diff --git a/core-client/src/transports/mod.rs b/core-client/transports/src/transports/mod.rs similarity index 100% rename from core-client/src/transports/mod.rs rename to core-client/transports/src/transports/mod.rs diff --git a/core-client/src/transports/ws.rs b/core-client/transports/src/transports/ws.rs similarity index 100% rename from core-client/src/transports/ws.rs rename to core-client/transports/src/transports/ws.rs diff --git a/core/Cargo.toml b/core/Cargo.toml index 73f52ba59..fdc705af9 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -8,7 +8,7 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"] license = "MIT" name = "jsonrpc-core" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" categories = [ "asynchronous", diff --git a/derive/Cargo.toml b/derive/Cargo.toml index afcfbca49..fb5e5db02 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://github.com/paritytech/jsonrpc" license = "MIT" name = "jsonrpc-derive" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" [lib] proc-macro = true @@ -19,10 +19,10 @@ quote = "0.6" proc-macro-crate = "0.1.3" [dev-dependencies] -jsonrpc-core = { version = "11.0", path = "../core" } -jsonrpc-core-client = { version = "11.0", path = "../core-client" } -jsonrpc-pubsub = { version = "11.0", path = "../pubsub" } -jsonrpc-tcp-server = { version = "11.0", path = "../tcp" } +jsonrpc-core = { version = "12.0", path = "../core" } +jsonrpc-core-client = { version = "12.0", path = "../core-client" } +jsonrpc-pubsub = { version = "12.0", path = "../pubsub" } +jsonrpc-tcp-server = { version = "12.0", path = "../tcp" } futures = "~0.1.6" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/http/Cargo.toml b/http/Cargo.toml index 1cefc7b31..4dcd8ff34 100644 --- a/http/Cargo.toml +++ b/http/Cargo.toml @@ -8,12 +8,12 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "server"] license = "MIT" name = "jsonrpc-http-server" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" [dependencies] hyper = "0.12" -jsonrpc-core = { version = "11.0", path = "../core" } -jsonrpc-server-utils = { version = "11.0", path = "../server-utils" } +jsonrpc-core = { version = "12.0", path = "../core" } +jsonrpc-server-utils = { version = "12.0", path = "../server-utils" } log = "0.4" net2 = "0.2" unicase = "2.0" diff --git a/http/README.md b/http/README.md index 1658fd61a..8a5a5e4c7 100644 --- a/http/README.md +++ b/http/README.md @@ -9,7 +9,7 @@ Rust http server using JSON-RPC 2.0. ``` [dependencies] -jsonrpc-http-server = "11.0" +jsonrpc-http-server = "12.0" ``` `main.rs` diff --git a/ipc/Cargo.toml b/ipc/Cargo.toml index 6c90d2a35..c517347f2 100644 --- a/ipc/Cargo.toml +++ b/ipc/Cargo.toml @@ -7,13 +7,13 @@ homepage = "https://github.com/paritytech/jsonrpc" license = "MIT" name = "jsonrpc-ipc-server" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" [dependencies] log = "0.4" tokio-service = "0.1" -jsonrpc-core = { version = "11.0", path = "../core" } -jsonrpc-server-utils = { version = "11.0", path = "../server-utils" } +jsonrpc-core = { version = "12.0", path = "../core" } +jsonrpc-server-utils = { version = "12.0", path = "../server-utils" } parity-tokio-ipc = "0.1" parking_lot = "0.8" diff --git a/ipc/README.md b/ipc/README.md index 73f4c402a..1600826d9 100644 --- a/ipc/README.md +++ b/ipc/README.md @@ -9,7 +9,7 @@ IPC server (Windows & Linux) for JSON-RPC 2.0. ``` [dependencies] -jsonrpc-ipc-server = "11.0" +jsonrpc-ipc-server = "12.0" ``` `main.rs` diff --git a/pubsub/Cargo.toml b/pubsub/Cargo.toml index 325d55c8d..96c9cf33a 100644 --- a/pubsub/Cargo.toml +++ b/pubsub/Cargo.toml @@ -8,16 +8,16 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "macros"] license = "MIT" name = "jsonrpc-pubsub" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" [dependencies] log = "0.4" parking_lot = "0.8" -jsonrpc-core = { version = "11.0", path = "../core" } +jsonrpc-core = { version = "12.0", path = "../core" } serde = "1.0" [dev-dependencies] -jsonrpc-tcp-server = { version = "11.0", path = "../tcp" } +jsonrpc-tcp-server = { version = "12.0", path = "../tcp" } [badges] travis-ci = { repository = "paritytech/jsonrpc", branch = "master"} diff --git a/pubsub/more-examples/Cargo.toml b/pubsub/more-examples/Cargo.toml index 58dc5fbd8..11803d693 100644 --- a/pubsub/more-examples/Cargo.toml +++ b/pubsub/more-examples/Cargo.toml @@ -3,12 +3,12 @@ name = "jsonrpc-pubsub-examples" description = "Examples of Publish-Subscribe extension for jsonrpc." homepage = "https://github.com/paritytech/jsonrpc" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" authors = ["tomusdrw "] license = "MIT" [dependencies] -jsonrpc-core = { version = "11.0", path = "../../core" } -jsonrpc-pubsub = { version = "11.0", path = "../" } -jsonrpc-ws-server = { version = "11.0", path = "../../ws" } -jsonrpc-ipc-server = { version = "11.0", path = "../../ipc" } +jsonrpc-core = { version = "12.0", path = "../../core" } +jsonrpc-pubsub = { version = "12.0", path = "../" } +jsonrpc-ws-server = { version = "12.0", path = "../../ws" } +jsonrpc-ipc-server = { version = "12.0", path = "../../ipc" } diff --git a/server-utils/Cargo.toml b/server-utils/Cargo.toml index e0fc9eb42..d9cc823e6 100644 --- a/server-utils/Cargo.toml +++ b/server-utils/Cargo.toml @@ -8,12 +8,12 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"] license = "MIT" name = "jsonrpc-server-utils" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" [dependencies] bytes = "0.4" globset = "0.4" -jsonrpc-core = { version = "11.0", path = "../core" } +jsonrpc-core = { version = "12.0", path = "../core" } lazy_static = "1.1.0" log = "0.4" num_cpus = "1.8" diff --git a/stdio/Cargo.toml b/stdio/Cargo.toml index a8a54da59..5dd60988e 100644 --- a/stdio/Cargo.toml +++ b/stdio/Cargo.toml @@ -7,11 +7,11 @@ homepage = "https://github.com/paritytech/jsonrpc" license = "MIT" name = "jsonrpc-stdio-server" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" [dependencies] futures = "0.1.23" -jsonrpc-core = { version = "11.0", path = "../core" } +jsonrpc-core = { version = "12.0", path = "../core" } log = "0.4" tokio = "0.1.7" tokio-codec = "0.1.0" diff --git a/stdio/README.md b/stdio/README.md index 1a8be41e0..74c6b4c27 100644 --- a/stdio/README.md +++ b/stdio/README.md @@ -10,7 +10,7 @@ Takes one request per line and outputs each response on a new line. ``` [dependencies] -jsonrpc-stdio-server = "11.0" +jsonrpc-stdio-server = "12.0" ``` `main.rs` diff --git a/tcp/Cargo.toml b/tcp/Cargo.toml index a9eeb50e1..6494020d5 100644 --- a/tcp/Cargo.toml +++ b/tcp/Cargo.toml @@ -7,14 +7,14 @@ homepage = "https://github.com/paritytech/jsonrpc" license = "MIT" name = "jsonrpc-tcp-server" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" [dependencies] log = "0.4" parking_lot = "0.8" tokio-service = "0.1" -jsonrpc-core = { version = "11.0", path = "../core" } -jsonrpc-server-utils = { version = "11.0", path = "../server-utils" } +jsonrpc-core = { version = "12.0", path = "../core" } +jsonrpc-server-utils = { version = "12.0", path = "../server-utils" } [dev-dependencies] lazy_static = "1.0" diff --git a/tcp/README.md b/tcp/README.md index 7b9aaf364..b1a3dd114 100644 --- a/tcp/README.md +++ b/tcp/README.md @@ -9,7 +9,7 @@ TCP server for JSON-RPC 2.0. ``` [dependencies] -jsonrpc-tcp-server = "11.0" +jsonrpc-tcp-server = "12.0" ``` `main.rs` diff --git a/test/Cargo.toml b/test/Cargo.toml index bde095ef1..e20089a2c 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "jsonrpc-test" description = "Simple test framework for JSON-RPC." -version = "11.0.0" +version = "12.0.0" authors = ["Tomasz Drwięga "] license = "MIT" homepage = "https://github.com/paritytech/jsonrpc" @@ -10,13 +10,13 @@ documentation = "https://docs.rs/jsonrpc-test/" edition = "2018" [dependencies] -jsonrpc-core = { path = "../core", version = "11.0" } -jsonrpc-core-client = { path = "../core-client", version = "11.0" } -jsonrpc-pubsub = { path = "../pubsub", version = "11.0" } +jsonrpc-core = { path = "../core", version = "12.0" } +jsonrpc-core-client = { path = "../core-client", version = "12.0" } +jsonrpc-pubsub = { path = "../pubsub", version = "12.0" } log = "0.4" serde = "1.0" serde_json = "1.0" [dev-dependencies] -jsonrpc-derive = { path = "../derive", version = "11.0" } +jsonrpc-derive = { path = "../derive", version = "12.0" } diff --git a/ws/Cargo.toml b/ws/Cargo.toml index 88bdc560d..eeaa29d0a 100644 --- a/ws/Cargo.toml +++ b/ws/Cargo.toml @@ -7,11 +7,11 @@ homepage = "https://github.com/paritytech/jsonrpc" license = "MIT" name = "jsonrpc-ws-server" repository = "https://github.com/paritytech/jsonrpc" -version = "11.0.0" +version = "12.0.0" [dependencies] -jsonrpc-core = { version = "11.0", path = "../core" } -jsonrpc-server-utils = { version = "11.0", path = "../server-utils" } +jsonrpc-core = { version = "12.0", path = "../core" } +jsonrpc-server-utils = { version = "12.0", path = "../server-utils" } log = "0.4" parking_lot = "0.8" slab = "0.4" diff --git a/ws/README.md b/ws/README.md index 177a2ac6a..461c2d8a1 100644 --- a/ws/README.md +++ b/ws/README.md @@ -9,7 +9,7 @@ WebSockets server for JSON-RPC 2.0. ``` [dependencies] -jsonrpc-ws-server = "11.0" +jsonrpc-ws-server = "12.0" ``` `main.rs`