diff --git a/Cargo.toml b/Cargo.toml index b9a9d96017..26a02c73da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,12 @@ description = "Submit extrinsics (transactions) to a substrate node via RPC" keywords = ["parity", "substrate", "blockchain"] include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] +[features] +default = ["tokio1"] +# jsonrpsee can be configured to use tokio02 or tokio1. +tokio02 = ["jsonrpsee-http-client/tokio02", "jsonrpsee-ws-client/tokio02"] +tokio1 = ["jsonrpsee-http-client/tokio1", "jsonrpsee-ws-client/tokio1"] + [dependencies] async-trait = "0.1.49" bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } @@ -24,10 +30,10 @@ chameleon = "0.1.0" scale-info = { version = "1.0.0", features = ["bit-vec"] } futures = "0.3.13" hex = "0.4.3" -jsonrpsee-proc-macros = "0.4.1" -jsonrpsee-ws-client = { version = "0.4.1", default-features = false } -jsonrpsee-http-client = { version = "0.4.1", default-features = false } -jsonrpsee-types = "0.4.1" +jsonrpsee-proc-macros = "0.3.0" +jsonrpsee-ws-client = { version = "0.3.0", default-features = false } +jsonrpsee-http-client = { version = "0.3.0", default-features = false } +jsonrpsee-types = "0.3.0" log = "0.4.14" num-traits = { version = "0.2.14", default-features = false } serde = { version = "1.0.124", features = ["derive"] } diff --git a/src/rpc.rs b/src/rpc.rs index 6afc717d28..423f11424b 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -220,7 +220,7 @@ impl RpcClient { method: &str, params: &[JsonValue], ) -> Result { - let params = Some(params.into()); + let params = params.into(); log::debug!("request {}: {:?}", method, params); let data = match self { Self::WebSocket(inner) => { @@ -238,7 +238,7 @@ impl RpcClient { params: &[JsonValue], unsubscribe_method: &str, ) -> Result, Error> { - let params = Some(params.into()); + let params = params.into(); match self { Self::WebSocket(inner) => { inner