Skip to content

Commit 78ace6d

Browse files
committed
Merge branch 'master' into dp/feature/http-close-handle-from-carllin
* master: Add client transport features (#439)
2 parents b271b11 + 8c0ada4 commit 78ace6d

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

.travis.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ before_script:
3030
- rustup component add rustfmt
3131

3232
script:
33-
- cargo build --all --features "$JSONRPC_CLIENT_FEATURES"
34-
- cargo test --all --features "$JSONRPC_CLIENT_FEATURES"
33+
- cargo build --all
34+
- cargo test --all
35+
- cargo test --manifest-path=core-client/Cargo.toml --features "http"
36+
- cargo test --manifest-path=core-client/Cargo.toml --features "http, tls"
37+
- cargo test --manifest-path=core-client/Cargo.toml --features "ws"
3538
- |
3639
([ $TRAVIS_RUST_VERSION = stable ] && cargo fmt --all -- --check) || true
3740
@@ -40,7 +43,6 @@ after_success: |
4043
[ $TRAVIS_BRANCH = master ] &&
4144
[ $TRAVIS_PULL_REQUEST = false ] &&
4245
[ $TRAVIS_RUST_VERSION = stable ] &&
43-
[ $JSONRPC_CLIENT_FEATURES = '' ] &&
4446
cargo doc --all --no-deps &&
4547
echo '<meta http-equiv=refresh content=0;url=jsonrpc_core/index.html>' > target/doc/index.html &&
4648
pip install --user ghp-import &&
@@ -50,6 +52,4 @@ after_success: |
5052
env:
5153
global:
5254
- secure: "QA4Rw78VSsP1vH2Yve1eAVpjG32HH9DZZ79xrhxZXp34wKoemp+aGqaFN/8uXPfsXshlYxtMCTT6M9OiWTTLvku5tI5kBsDneu8mLut7eBZHVniYSp2SbKpTeqfpGMDHoCR0WD9AlWDn9Elm6txbghXjrxhCMg8gkhhsLGnQt/ARFF1wRHnXT0TjJg8fQtd+/OK0TaRfknx1RptruaznxfUi3DBwzDdzaMMZfd3VjWR1hPFRpDSL0mM+l6OjNrLbCeiR//k3lV4rpIhedsz0ODjfW2Hdk63qCaLJsXCkG1Bcuf/FYbYC+osm5SrHhGA1j2EgazWcLA6Wkzt15KPOR/HirNj+PCiS0YbGKM5Ac5LT6m6q0iYSF/pq1+jDurcSwBwYrTOY6X2FZCZQBfTP/4qnSjWgGPOkzBSMS6BNEBDQZgdc3xCASXadj7waF4Y4UGD0bDPuBtXopI4ppKLqSa7CsvKz6TX2yW0UVgUuQ5/jz/S+fkcz74o016d5x027yjaxAu/Z8fQFLSaBtiFU8sBzA+MDU3apFgjsYXiaGYZ8gDrp7WjbfHNYfBAMEHHKY4toywB5Vi8zJxF+Wn1n4hkvb/kDqSV9giFmWEg321U+pAGNAH4yY25tIJqS8gT89cz4oQJp7aWjA3Ke01e104yqqZU+N+CSyZHEeksdPt8="
53-
matrix:
54-
- JSONRPC_CLIENT_FEATURES=''
55-
- JSONRPC_CLIENT_FEATURES='tls'
55+

core-client/Cargo.toml

+9-3
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,30 @@ categories = [
2020

2121
[features]
2222
tls = ["hyper-tls"]
23+
http = ["hyper"]
24+
ws = [
25+
"websocket",
26+
"tokio",
27+
]
2328

2429
[dependencies]
2530
failure = "0.1"
2631
futures = "0.1.26"
27-
hyper = "0.12"
32+
hyper = { version = "0.12", optional = true }
2833
hyper-tls = { version = "0.3.2", optional = true }
2934
jsonrpc-core = { version = "11.0", path = "../core" }
3035
log = "0.4"
3136
serde = "1.0"
3237
serde_json = "1.0"
33-
tokio = "0.1"
34-
websocket = "0.22"
38+
tokio = { version = "0.1", optional = true }
39+
websocket = { version = "0.22", optional = true }
3540

3641
[dev-dependencies]
3742
assert_matches = "1.1"
3843
jsonrpc-http-server = { version = "11.0", path = "../http" }
3944
lazy_static = "1.0"
4045
env_logger = "0.6"
46+
tokio = "0.1"
4147

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

core-client/src/transports/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ use serde_json::Value;
66
use crate::{RpcError, RpcMessage};
77

88
pub mod duplex;
9+
#[cfg(feature = "http")]
910
pub mod http;
1011
pub mod local;
12+
#[cfg(feature = "ws")]
1113
pub mod ws;
1214

1315
pub use duplex::duplex;

0 commit comments

Comments
 (0)