Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsonrpsee http client]: support tokio1 & tokio02. #263

Merged
merged 2 commits into from
Apr 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ keywords = ["parity", "substrate", "blockchain"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]

[features]
default = []
default = ["tokio1"]
client = ["substrate-subxt-client"]
# jsonrpsee http client can be configured to use tokio02 or tokio1.
tokio02 = ["jsonrpsee-http-client/tokio02"]
tokio1 = ["jsonrpsee-http-client/tokio1"]

[dependencies]
log = "0.4.14"
thiserror = "1.0.24"
futures = "0.3.13"
jsonrpsee-types = "=0.2.0-alpha.3"
jsonrpsee-ws-client = "=0.2.0-alpha.3"
jsonrpsee-http-client = "=0.2.0-alpha.3"
jsonrpsee-http-client = { version = "=0.2.0-alpha.3", default-features = false, optional = true }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it optional, in case we use default-features = false when depending on subxt. Wouldn't that cause a compilation error?

Copy link
Member Author

@niklasad1 niklasad1 Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right good catch, it doesn't need to be optional.

However, if tokio1 or tokio02 is not enabled on jsonrpsee-http-client it will be a compilation error anyway. So doesn't really make a difference in practice.

Thus, if users don't use the default features and not enabled exactly one the features the compilation error might be a little tricky to figure out.

We got this https://github.com/paritytech/jsonrpsee/blob/master/http-client/src/lib.rs#L23-#L27 for now hopefully this goes away very soon but probably not ^^

num-traits = { version = "0.2.14", default-features = false }
serde = { version = "1.0.124", features = ["derive"] }
serde_json = "1.0.64"
Expand Down