chore(deps): bump jsonrpsee v0.20 to v0.21 (#1347)

* chore(deps): bump jsonrpsee v0.20 to v0.21

* fix build

* update Cargo.lock in wasm-tests
This commit is contained in:
Niklas Adolfsson
2024-01-12 10:48:44 +01:00
committed by GitHub
parent fc5a18aaa0
commit ee95026186
13 changed files with 1093 additions and 794 deletions
Generated
+91 -22
View File
@@ -1758,9 +1758,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = "gloo-net"
version = "0.4.0"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4"
checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173"
dependencies = [
"futures-channel",
"futures-core",
@@ -2015,10 +2015,10 @@ dependencies = [
"http",
"hyper",
"log",
"rustls",
"rustls-native-certs",
"rustls 0.21.9",
"rustls-native-certs 0.6.3",
"tokio",
"tokio-rustls",
"tokio-rustls 0.24.1",
]
[[package]]
@@ -2224,9 +2224,9 @@ dependencies = [
[[package]]
name = "jsonrpsee"
version = "0.20.3"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc"
checksum = "9579d0ca9fb30da026bac2f0f7d9576ec93489aeb7cd4971dd5b4617d82c79b2"
dependencies = [
"jsonrpsee-client-transport",
"jsonrpsee-core",
@@ -2236,9 +2236,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-client-transport"
version = "0.20.3"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935"
checksum = "3f9f9ed46590a8d5681975f126e22531698211b926129a40a2db47cbca429220"
dependencies = [
"futures-channel",
"futures-util",
@@ -2246,11 +2246,12 @@ dependencies = [
"http",
"jsonrpsee-core",
"pin-project",
"rustls-native-certs",
"rustls-native-certs 0.7.0",
"rustls-pki-types",
"soketto",
"thiserror",
"tokio",
"tokio-rustls",
"tokio-rustls 0.25.0",
"tokio-util",
"tracing",
"url",
@@ -2258,32 +2259,34 @@ dependencies = [
[[package]]
name = "jsonrpsee-core"
version = "0.20.3"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b"
checksum = "776d009e2f591b78c038e0d053a796f94575d66ca4e77dd84bfc5e81419e436c"
dependencies = [
"anyhow",
"async-lock 2.8.0",
"async-lock 3.2.0",
"async-trait",
"beef",
"futures-timer",
"futures-util",
"hyper",
"jsonrpsee-types",
"pin-project",
"rustc-hash",
"serde",
"serde_json",
"thiserror",
"tokio",
"tokio-stream",
"tracing",
"wasm-bindgen-futures",
]
[[package]]
name = "jsonrpsee-http-client"
version = "0.20.3"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20"
checksum = "78b7de9f3219d95985eb77fd03194d7c1b56c19bce1abfcc9d07462574b15572"
dependencies = [
"async-trait",
"hyper",
@@ -2301,16 +2304,15 @@ dependencies = [
[[package]]
name = "jsonrpsee-types"
version = "0.20.3"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9"
checksum = "3266dfb045c9174b24c77c2dfe0084914bb23a6b2597d70c9dc6018392e1cd1b"
dependencies = [
"anyhow",
"beef",
"serde",
"serde_json",
"thiserror",
"tracing",
]
[[package]]
@@ -3229,10 +3231,24 @@ checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba"
dependencies = [
"log",
"ring",
"rustls-webpki",
"rustls-webpki 0.101.7",
"sct",
]
[[package]]
name = "rustls"
version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41"
dependencies = [
"log",
"ring",
"rustls-pki-types",
"rustls-webpki 0.102.1",
"subtle",
"zeroize",
]
[[package]]
name = "rustls-native-certs"
version = "0.6.3"
@@ -3240,7 +3256,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00"
dependencies = [
"openssl-probe",
"rustls-pemfile",
"rustls-pemfile 1.0.4",
"schannel",
"security-framework",
]
[[package]]
name = "rustls-native-certs"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792"
dependencies = [
"openssl-probe",
"rustls-pemfile 2.0.0",
"rustls-pki-types",
"schannel",
"security-framework",
]
@@ -3254,6 +3283,22 @@ dependencies = [
"base64 0.21.6",
]
[[package]]
name = "rustls-pemfile"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4"
dependencies = [
"base64 0.21.5",
"rustls-pki-types",
]
[[package]]
name = "rustls-pki-types"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e9d979b3ce68192e42760c7810125eb6cf2ea10efae545a156063e61f314e2a"
[[package]]
name = "rustls-webpki"
version = "0.101.7"
@@ -3264,6 +3309,17 @@ dependencies = [
"untrusted",
]
[[package]]
name = "rustls-webpki"
version = "0.102.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b"
dependencies = [
"ring",
"rustls-pki-types",
"untrusted",
]
[[package]]
name = "rustversion"
version = "1.0.14"
@@ -4332,6 +4388,7 @@ dependencies = [
"thiserror",
"tokio",
"tokio-stream",
"tokio-util",
"tracing",
"tracing-subscriber 0.3.18",
"url",
@@ -4509,6 +4566,7 @@ dependencies = [
"substrate-runner",
"subxt",
"tokio",
"tokio-util",
"which",
]
@@ -4607,7 +4665,18 @@ version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
dependencies = [
"rustls",
"rustls 0.21.9",
"tokio",
]
[[package]]
name = "tokio-rustls"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f"
dependencies = [
"rustls 0.22.2",
"rustls-pki-types",
"tokio",
]
+1 -1
View File
@@ -69,7 +69,7 @@ getrandom = { version = "0.2", default-features = false }
hex = "0.4.3"
heck = "0.4.1"
impl-serde = { version = "0.4.0" }
jsonrpsee = { version = "0.20" }
jsonrpsee = { version = "0.21" }
pretty_assertions = "1.4.0"
primitive-types = { version = "0.12.2", default-features = false, features = ["codec", "scale-info", "serde"] }
proc-macro-error = "1.0.4"
+2 -2
View File
@@ -5,7 +5,7 @@
use jsonrpsee::{
async_client::ClientBuilder,
client_transport::ws::WsTransportClientBuilder,
core::{client::ClientT, Error},
core::client::{ClientT, Error},
http_client::HttpClientBuilder,
};
use std::time::Duration;
@@ -56,7 +56,7 @@ pub async fn fetch_chain_spec(url: Url) -> Result<serde_json::Value, FetchSpecEr
pub enum FetchSpecError {
/// JSON-RPC error fetching metadata.
#[error("Request error: {0}")]
RequestError(#[from] jsonrpsee::core::Error),
RequestError(#[from] jsonrpsee::core::ClientError),
/// URL scheme is not http, https, ws or wss.
#[error("'{0}' not supported, supported URI schemes are http, https, ws or wss.")]
InvalidScheme(String),
+1 -1
View File
@@ -86,7 +86,7 @@ pub enum FetchMetadataError {
/// JSON-RPC error fetching metadata.
#[cfg(feature = "fetch-metadata")]
#[error("Request error: {0}")]
RequestError(#[from] jsonrpsee::core::Error),
RequestError(#[from] jsonrpsee::core::ClientError),
/// Failed IO when fetching from a file.
#[error("Failed IO for {0}, make sure that you are providing the correct file path for metadata: {1}")]
Io(String, std::io::Error),
+1 -1
View File
@@ -9,7 +9,7 @@ use codec::{Decode, Encode};
use jsonrpsee::{
async_client::ClientBuilder,
client_transport::ws::WsTransportClientBuilder,
core::{client::ClientT, Error},
core::client::{ClientT, Error},
http_client::HttpClientBuilder,
rpc_params,
};
+5 -1
View File
@@ -27,7 +27,8 @@ default = ["jsonrpsee", "native"]
native = [
"jsonrpsee?/async-client",
"jsonrpsee?/client-ws-transport-native-tls",
"subxt-lightclient?/native"
"subxt-lightclient?/native",
"tokio-util"
]
# Enable this for web/wasm builds.
@@ -100,6 +101,9 @@ url = { workspace = true }
# Included if "web" feature is enabled, to enable its js feature.
getrandom = { workspace = true, optional = true }
# Included if "native" feature is enabled
tokio-util = { workspace = true, features = ["compat"], optional = true }
[dev-dependencies]
bitvec = { workspace = true }
codec = { workspace = true, features = ["derive", "bit-vec"] }
+1 -2
View File
@@ -9,7 +9,6 @@ use jsonrpsee::{
core::{
client::{Client, ClientT, SubscriptionClientT, SubscriptionKind},
traits::ToRpcParams,
Error as JsonRpseeError,
},
types::SubscriptionId,
};
@@ -18,7 +17,7 @@ use serde_json::value::RawValue;
struct Params(Option<Box<RawValue>>);
impl ToRpcParams for Params {
fn to_rpc_params(self) -> Result<Option<Box<RawValue>>, JsonRpseeError> {
fn to_rpc_params(self) -> Result<Option<Box<RawValue>>, serde_json::Error> {
Ok(self.0)
}
}
+7 -6
View File
@@ -240,9 +240,13 @@ impl<Res: DeserializeOwned> Stream for RpcSubscription<Res> {
#[cfg(all(feature = "jsonrpsee", feature = "native"))]
mod jsonrpsee_helpers {
pub use jsonrpsee::{
client_transport::ws::{Receiver, Sender, Url, WsTransportClientBuilder},
core::{client::Client, Error},
client_transport::ws::{self, EitherStream, Url, WsTransportClientBuilder},
core::client::{Client, Error},
};
use tokio_util::compat::Compat;
pub type Sender = ws::Sender<Compat<EitherStream>>;
pub type Receiver = ws::Receiver<Compat<EitherStream>>;
/// Build WS RPC client from URL
pub async fn client(url: &str) -> Result<Client, Error> {
@@ -266,10 +270,7 @@ mod jsonrpsee_helpers {
mod jsonrpsee_helpers {
pub use jsonrpsee::{
client_transport::web,
core::{
client::{Client, ClientBuilder},
Error,
},
core::client::{Client, ClientBuilder, Error},
};
/// Build web RPC client from URL
+6 -2
View File
@@ -5,7 +5,6 @@
use super::{rpc::LightClientRpc, LightClient, LightClientError};
use crate::backend::rpc::RpcClient;
use crate::client::RawLightClient;
use crate::error::RpcError;
use crate::utils::validate_url_is_secure;
use crate::{config::Config, error::Error, OnlineClient};
use std::num::NonZeroU32;
@@ -259,11 +258,16 @@ async fn fetch_url(url: impl AsRef<str>) -> Result<serde_json::Value, Error> {
#[cfg(all(feature = "jsonrpsee", feature = "native"))]
mod jsonrpsee_helpers {
use crate::error::{Error, LightClientError};
use tokio_util::compat::Compat;
pub use jsonrpsee::{
client_transport::ws::{Receiver, Sender, Url, WsTransportClientBuilder},
client_transport::ws::{self, EitherStream, Url, WsTransportClientBuilder},
core::client::Client,
};
pub type Sender = ws::Sender<Compat<EitherStream>>;
pub type Receiver = ws::Receiver<Compat<EitherStream>>;
/// Build WS RPC client from URL
pub async fn client(url: &str) -> Result<Client, Error> {
let url = Url::parse(url).map_err(|_| Error::LightClient(LightClientError::InvalidUrl))?;
+1
View File
@@ -12,6 +12,7 @@ substrate-runner = { workspace = true }
impl-serde = { workspace = true }
serde = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread"] }
tokio-util = { workspace = true, features = ["compat"] }
which = { workspace = true }
jsonrpsee = { workspace = true, features = ["async-client", "client-ws-transport-native-tls"] }
hex = { workspace = true }
+6 -2
View File
@@ -101,12 +101,16 @@ async fn run() {
// Use jsonrpsee to obtain metadata from the node.
mod client {
use jsonrpsee::client_transport::ws::EitherStream;
pub use jsonrpsee::{
client_transport::ws::{Receiver, Sender, Url, WsTransportClientBuilder},
core::{client::Client, Error},
client_transport::ws::{self, Url, WsTransportClientBuilder},
core::client::{Client, Error},
};
use tokio_util::compat::Compat;
pub use jsonrpsee::core::{client::ClientT, rpc_params};
pub type Sender = ws::Sender<Compat<EitherStream>>;
pub type Receiver = ws::Receiver<Compat<EitherStream>>;
/// Build WS RPC client from URL
pub async fn build(url: &str) -> Result<Client, Error> {
+502 -366
View File
File diff suppressed because it is too large Load Diff
+469 -388
View File
File diff suppressed because it is too large Load Diff