Skip to content

Commit 99bd064

Browse files
authored
Migrate core to futures=0.3 (#565)
* Update to latest futures. * Rewrite core? * pubsub rewrite. * Fix pubsub tests & rewrite tcp. * Update stdio. * ipc & stdio & ws * Cargo check ✅ * Fixing tests 🤔 * Unify Result/BoxFuture for derive. * Rewrite clients for new futures. * Fix derive. * Fix client tests. * Remove unused functions. * Bump version. * cargo fmt --all * Addressing review grumbles. * Rewrite with async-await. * Add a issue number. * cargo fmt --all * Fix test.
1 parent 57575ef commit 99bd064

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1211
-1201
lines changed

core-client/Cargo.toml

+9-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"]
88
license = "MIT"
99
name = "jsonrpc-core-client"
1010
repository = "https://github.com/paritytech/jsonrpc"
11-
version = "14.2.0"
11+
version = "15.0.0"
1212

1313
categories = [
1414
"asynchronous",
@@ -19,14 +19,17 @@ categories = [
1919
]
2020

2121
[features]
22-
tls = ["jsonrpc-client-transports/tls"]
23-
http = ["jsonrpc-client-transports/http"]
24-
ws = ["jsonrpc-client-transports/ws"]
25-
ipc = ["jsonrpc-client-transports/ipc"]
22+
tls = ["jsonrpc-client-transports/tls", "futures01"]
23+
http = ["jsonrpc-client-transports/http", "futures01"]
24+
ws = ["jsonrpc-client-transports/ws", "futures01"]
25+
ipc = ["jsonrpc-client-transports/ipc", "futures01"]
2626
arbitrary_precision = ["jsonrpc-client-transports/arbitrary_precision"]
2727

2828
[dependencies]
29-
jsonrpc-client-transports = { version = "14.2", path = "./transports", default-features = false }
29+
jsonrpc-client-transports = { version = "15.0", path = "./transports", default-features = false }
30+
# Only for client transports, should be removed when we fully transition to futures=0.3
31+
futures01 = { version = "0.1", package = "futures", optional = true }
32+
futures = { version = "0.3", features = [ "compat" ] }
3033

3134
[badges]
3235
travis-ci = { repository = "paritytech/jsonrpc", branch = "master"}

core-client/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@
77
88
#![deny(missing_docs)]
99

10+
pub use futures;
1011
pub use jsonrpc_client_transports::*;
12+
13+
#[cfg(feature = "futures01")]
14+
pub use futures01;

core-client/transports/Cargo.toml

+16-13
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords = ["jsonrpc", "json-rpc", "json", "rpc", "serde"]
88
license = "MIT"
99
name = "jsonrpc-client-transports"
1010
repository = "https://github.com/paritytech/jsonrpc"
11-
version = "14.2.0"
11+
version = "15.0.0"
1212

1313
categories = [
1414
"asynchronous",
@@ -21,41 +21,44 @@ categories = [
2121
[features]
2222
default = ["http", "tls", "ws"]
2323
tls = ["hyper-tls", "http"]
24-
http = ["hyper"]
24+
http = ["hyper", "futures01"]
2525
ws = [
2626
"websocket",
2727
"tokio",
28+
"futures01",
2829
]
2930
ipc = [
3031
"parity-tokio-ipc",
3132
"jsonrpc-server-utils",
3233
"tokio",
34+
"futures01",
3335
]
3436
arbitrary_precision = ["serde_json/arbitrary_precision", "jsonrpc-core/arbitrary_precision"]
3537

3638
[dependencies]
3739
failure = "0.1"
38-
futures = "0.1.26"
39-
hyper = { version = "0.12", optional = true }
40-
hyper-tls = { version = "0.3.2", optional = true }
41-
jsonrpc-core = { version = "14.2", path = "../../core" }
42-
jsonrpc-pubsub = { version = "14.2", path = "../../pubsub" }
43-
jsonrpc-server-utils = { version = "14.2", path = "../../server-utils", optional = true }
40+
futures = { version = "0.3", features = [ "compat" ] }
41+
jsonrpc-core = { version = "15.0", path = "../../core" }
42+
jsonrpc-pubsub = { version = "15.0", path = "../../pubsub" }
4443
log = "0.4"
45-
parity-tokio-ipc = { version = "0.2", optional = true }
4644
serde = { version = "1.0", features = ["derive"] }
4745
serde_json = "1.0"
46+
url = "1.7"
47+
48+
futures01 = { version = "0.1.26", package = "futures", optional = true }
49+
hyper = { version = "0.12", optional = true }
50+
hyper-tls = { version = "0.3.2", optional = true }
51+
jsonrpc-server-utils = { version = "15.0", path = "../../server-utils", optional = true }
52+
parity-tokio-ipc = { version = "0.2", optional = true }
4853
tokio = { version = "0.1", optional = true }
4954
websocket = { version = "0.24", optional = true }
50-
url = "1.7"
5155

5256
[dev-dependencies]
5357
assert_matches = "1.1"
54-
jsonrpc-http-server = { version = "14.2", path = "../../http" }
55-
jsonrpc-ipc-server = { version = "14.2", path = "../../ipc" }
58+
jsonrpc-http-server = { version = "15.0", path = "../../http" }
59+
jsonrpc-ipc-server = { version = "15.0", path = "../../ipc" }
5660
lazy_static = "1.0"
5761
env_logger = "0.7"
58-
tokio = "0.1"
5962

6063
[badges]
6164
travis-ci = { repository = "paritytech/jsonrpc", branch = "master" }

0 commit comments

Comments
 (0)