diff --git a/src/rpc.rs b/src/rpc.rs index 4fc1a393cd..4d6a743148 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -35,10 +35,10 @@ use core::{ use frame_metadata::RuntimeMetadataPrefixed; pub use jsonrpsee::{ client_transport::ws::{ + Receiver as WsReceiver, + Sender as WsSender, Uri, WsTransportClientBuilder, - Sender as WsSender, - Receiver as WsReceiver, }, core_client::{ Client as RpcClient, @@ -663,8 +663,7 @@ pub async fn build_ws_client(url: &str) -> Result { } async fn ws_transport(url: &str) -> (WsSender, WsReceiver) { - // TODO: fix unwraps because I'm lazy. - + // fix unwraps because I'm lazy. let url: Uri = url.parse().unwrap(); WsTransportClientBuilder::default() .build(url) diff --git a/test-runtime/build.rs b/test-runtime/build.rs index b6f50ba155..48fdbf158a 100644 --- a/test-runtime/build.rs +++ b/test-runtime/build.rs @@ -27,7 +27,11 @@ use std::{ thread, time, }; -use subxt::rpc::{Client as _, rpc_params, build_ws_client}; +use subxt::rpc::{ + build_ws_client, + rpc_params, + Client as _, +}; static SUBSTRATE_BIN_ENV_VAR: &str = "SUBSTRATE_NODE_PATH"; @@ -61,12 +65,11 @@ async fn main() { if retries >= MAX_RETRIES { panic!("Cannot connect to substrate node after {} retries", retries); } - let res = - build_ws_client(&format!("ws://localhost:{}", port)) - .await - .expect("should only error if malformed URL for an HTTP connection") - .request("state_getMetadata", rpc_params![]) - .await; + let res = build_ws_client(&format!("ws://localhost:{}", port)) + .await + .expect("should only error if malformed URL for an HTTP connection") + .request("state_getMetadata", rpc_params![]) + .await; match res { Ok(res) => { let _ = cmd.kill();