diff --git a/rpcs/src/client/mod.rs b/rpcs/src/client/mod.rs index 056ed94681..c380499913 100644 --- a/rpcs/src/client/mod.rs +++ b/rpcs/src/client/mod.rs @@ -58,12 +58,12 @@ crate::macros::cfg_jsonrpsee! { mod jsonrpsee_impl; - pub use jsonrpsee::core::client::Client as JsonrpseeRpcClient; + pub use jsonrpsee::core::client::Client as JsonrpseeRpcClient; } crate::macros::cfg_unstable_light_client! { mod lightclient_impl; - pub use lightclient_impl::LightClientRpc as LightClientRpcClient; + pub use lightclient_impl::LightClientRpc as LightClientRpcClient; } crate::macros::cfg_reconnecting_rpc_client! { diff --git a/rpcs/src/client/rpc_client.rs b/rpcs/src/client/rpc_client.rs index 94bcc2ba20..bfea732309 100644 --- a/rpcs/src/client/rpc_client.rs +++ b/rpcs/src/client/rpc_client.rs @@ -165,8 +165,7 @@ impl RpcParams { } else { self.0.push(b',') } - serde_json::to_writer(&mut self.0, ¶m) - .map_err(Error::Deserialization)?; + serde_json::to_writer(&mut self.0, ¶m).map_err(Error::Deserialization)?; Ok(()) } /// Build a [`RawValue`] from our params, returning `None` if no parameters @@ -236,8 +235,9 @@ impl Stream for RpcSubscription { // Decode the inner RawValue to the type we're expecting and map // any errors to the right shape: let res = res.map(|r| { - r.map_err(|e| e.into()) - .and_then(|raw_val| serde_json::from_str(raw_val.get()).map_err(Error::Deserialization)) + r.map_err(|e| e.into()).and_then(|raw_val| { + serde_json::from_str(raw_val.get()).map_err(Error::Deserialization) + }) }); Poll::Ready(res) diff --git a/rpcs/src/client/rpc_client_t.rs b/rpcs/src/client/rpc_client_t.rs index 68fce96312..66075fd688 100644 --- a/rpcs/src/client/rpc_client_t.rs +++ b/rpcs/src/client/rpc_client_t.rs @@ -2,9 +2,9 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. +use crate::Error; use futures::Stream; use std::{future::Future, pin::Pin}; -use crate::Error; // Re-exporting for simplicity since it's used a bunch in the trait definition. pub use serde_json::value::RawValue; diff --git a/rpcs/src/lib.rs b/rpcs/src/lib.rs index 65acf3cd0d..3aa287a3cd 100644 --- a/rpcs/src/lib.rs +++ b/rpcs/src/lib.rs @@ -10,19 +10,18 @@ ))] compile_error!("subxt-rpcs: exactly one of the 'web' and 'native' features should be used."); - mod macros; -pub mod utils; pub mod client; pub mod methods; +pub mod utils; // Expose the most common things at the top level: -pub use client::{ RpcClient, RpcClientT }; -pub use methods::{ ChainHeadRpcMethods, LegacyRpcMethods }; +pub use client::{RpcClient, RpcClientT}; +pub use methods::{ChainHeadRpcMethods, LegacyRpcMethods}; /// Configuration used by some of the RPC methods to determine the shape of -/// some of the inputs or responses. +/// some of the inputs or responses. pub trait RpcConfig { /// The block header type. type Header: Header; @@ -34,20 +33,23 @@ pub trait RpcConfig { /// A trait which is applied to any type that is a valid block header. pub trait Header: std::fmt::Debug + codec::Decode + serde::de::DeserializeOwned {} -impl Header for T where T: std::fmt::Debug + codec::Decode + serde::de::DeserializeOwned {} +impl Header for T where T: std::fmt::Debug + codec::Decode + serde::de::DeserializeOwned {} /// A trait which is applied to any type that is a valid block hash. pub trait BlockHash: serde::de::DeserializeOwned + serde::Serialize {} -impl BlockHash for T where T: serde::de::DeserializeOwned + serde::Serialize {} +impl BlockHash for T where T: serde::de::DeserializeOwned + serde::Serialize {} /// A trait which is applied to any type that is a valid Account ID. pub trait AccountId: serde::Serialize {} -impl AccountId for T where T: serde::Serialize {} +impl AccountId for T where T: serde::Serialize {} #[cfg(feature = "subxt-core")] mod impl_config { use super::*; - impl RpcConfig for T where T: subxt_core::Config { + impl RpcConfig for T + where + T: subxt_core::Config, + { type Header = T::Header; type Hash = T::Hash; type AccountId = T::AccountId; diff --git a/rpcs/src/methods/chain_head.rs b/rpcs/src/methods/chain_head.rs index 6d1faeacde..6b7c958172 100644 --- a/rpcs/src/methods/chain_head.rs +++ b/rpcs/src/methods/chain_head.rs @@ -8,7 +8,7 @@ use crate::client::{rpc_params, RpcClient, RpcSubscription}; use crate::BlockHash; -use crate::{RpcConfig, Error}; +use crate::{Error, RpcConfig}; use derive_where::derive_where; use futures::{Stream, StreamExt}; use serde::{Deserialize, Deserializer, Serialize}; diff --git a/rpcs/src/methods/legacy.rs b/rpcs/src/methods/legacy.rs index 0125ee1ec0..a2b7690f91 100644 --- a/rpcs/src/methods/legacy.rs +++ b/rpcs/src/methods/legacy.rs @@ -5,10 +5,10 @@ //! An interface to call the raw legacy RPC methods. use crate::client::{rpc_params, RpcClient, RpcSubscription}; -use crate::{RpcConfig, Error}; +use crate::{Error, RpcConfig}; use codec::Decode; -use frame_metadata::RuntimeMetadataPrefixed; use derive_where::derive_where; +use frame_metadata::RuntimeMetadataPrefixed; use primitive_types::U256; use serde::{Deserialize, Serialize}; @@ -101,7 +101,10 @@ impl LegacyRpcMethods { } /// Fetch the metadata via the legacy `state_getMetadata` RPC method. - pub async fn state_get_metadata(&self, at: Option) -> Result { + pub async fn state_get_metadata( + &self, + at: Option, + ) -> Result { let bytes: Bytes = self .client .request("state_getMetadata", rpc_params![at]) @@ -398,12 +401,14 @@ impl LegacyRpcMethods { pub struct StateGetMetadataResponse(Vec); impl StateGetMetadataResponse { - /// Return the raw SCALE encoded metadata bytes + /// Return the raw SCALE encoded metadata bytes pub fn into_raw(self) -> Vec { self.0 } /// Decode and return [`frame_metadata::RuntimeMetadataPrefixed`]. - pub fn to_frame_metadata(&self) -> Result { + pub fn to_frame_metadata( + &self, + ) -> Result { RuntimeMetadataPrefixed::decode(&mut &*self.0) } } diff --git a/rpcs/src/methods/mod.rs b/rpcs/src/methods/mod.rs index 98b4252ea7..c61736bade 100644 --- a/rpcs/src/methods/mod.rs +++ b/rpcs/src/methods/mod.rs @@ -3,12 +3,12 @@ // see LICENSE for license details. //! RPC methods are defined in this module. At the moment we have: -//! +//! //! - [`ChainHeadRpcMethods`] (and the types in [`chain_head`]): these methods //! implement the RPC spec at -//! +//! //! We also have (although their use is not advised): -//! +//! //! - [`LegacyRpcMethods`] (and the types in [`legacy`]): a collection of legacy RPCs. //! These are not well specified and may change in implementations without warning, //! but for those methods we expose, we make a best effort to work against latest Substrate versions. @@ -17,4 +17,4 @@ pub mod chain_head; pub mod legacy; pub use chain_head::ChainHeadRpcMethods; -pub use legacy::LegacyRpcMethods; \ No newline at end of file +pub use legacy::LegacyRpcMethods; diff --git a/rpcs/src/utils.rs b/rpcs/src/utils.rs index 1d61c7854f..b77462f32e 100644 --- a/rpcs/src/utils.rs +++ b/rpcs/src/utils.rs @@ -4,8 +4,8 @@ //! A couple of utility methods that we make use of. -use url::Url; use crate::Error; +use url::Url; /// A URL is considered secure if it uses a secure scheme ("https" or "wss") or is referring to localhost. /// @@ -30,4 +30,4 @@ pub fn validate_url_is_secure(url: &str) -> Result<(), Error> { } else { Ok(()) } -} \ No newline at end of file +} diff --git a/subxt/src/backend/chain_head/follow_stream.rs b/subxt/src/backend/chain_head/follow_stream.rs index 5d2d557d7f..0fecd3bc89 100644 --- a/subxt/src/backend/chain_head/follow_stream.rs +++ b/subxt/src/backend/chain_head/follow_stream.rs @@ -4,11 +4,11 @@ use crate::config::Config; use crate::error::Error; -use subxt_rpcs::methods::chain_head::{ChainHeadRpcMethods, FollowEvent}; use futures::{FutureExt, Stream, StreamExt, TryStreamExt}; use std::future::Future; use std::pin::Pin; use std::task::{Context, Poll}; +use subxt_rpcs::methods::chain_head::{ChainHeadRpcMethods, FollowEvent}; /// A `Stream` whose goal is to remain subscribed to `chainHead_follow`. It will re-subscribe if the subscription /// is ended for any reason, and it will return the current `subscription_id` as an event, along with the other @@ -217,12 +217,10 @@ impl Stream for FollowStream { #[cfg(test)] pub(super) mod test_utils { use super::*; - use subxt_rpcs::methods::chain_head::{ - BestBlockChanged, Finalized, Initialized, NewBlock, - }; use crate::config::substrate::H256; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; + use subxt_rpcs::methods::chain_head::{BestBlockChanged, Finalized, Initialized, NewBlock}; /// Given some events, returns a follow stream getter that we can use in /// place of the usual RPC method. diff --git a/subxt/src/backend/chain_head/follow_stream_driver.rs b/subxt/src/backend/chain_head/follow_stream_driver.rs index 15a6c8c52e..70c49dbf4c 100644 --- a/subxt/src/backend/chain_head/follow_stream_driver.rs +++ b/subxt/src/backend/chain_head/follow_stream_driver.rs @@ -5,13 +5,13 @@ use super::follow_stream_unpin::{BlockRef, FollowStreamMsg, FollowStreamUnpin}; use crate::config::BlockHash; use crate::error::{Error, RpcError}; -use subxt_rpcs::methods::chain_head::{FollowEvent, Initialized, RuntimeEvent}; use futures::stream::{Stream, StreamExt}; use std::collections::{HashMap, HashSet, VecDeque}; use std::ops::DerefMut; use std::pin::Pin; use std::sync::{Arc, Mutex}; use std::task::{Context, Poll, Waker}; +use subxt_rpcs::methods::chain_head::{FollowEvent, Initialized, RuntimeEvent}; /// A `Stream` which builds on `FollowStreamDriver`, and allows multiple subscribers to obtain events /// from the single underlying subscription (each being provided an `Initialized` message and all new @@ -454,9 +454,12 @@ where .iter() .position(|b| b.hash() == p.hash()) else { - return Poll::Ready(Some(Err(RpcError::ClientError(subxt_rpcs::Error::DisconnectedWillReconnect( - "Missed at least one block when the connection was lost".to_owned(), - )) + return Poll::Ready(Some(Err(RpcError::ClientError( + subxt_rpcs::Error::DisconnectedWillReconnect( + "Missed at least one block when the connection was lost" + .to_owned(), + ), + ) .into()))); }; diff --git a/subxt/src/backend/chain_head/follow_stream_unpin.rs b/subxt/src/backend/chain_head/follow_stream_unpin.rs index f2dcad788a..a3aca94a34 100644 --- a/subxt/src/backend/chain_head/follow_stream_unpin.rs +++ b/subxt/src/backend/chain_head/follow_stream_unpin.rs @@ -6,10 +6,10 @@ use super::follow_stream::FollowStream; use super::ChainHeadRpcMethods; use crate::config::{BlockHash, Config}; use crate::error::Error; +use futures::stream::{FuturesUnordered, Stream, StreamExt}; use subxt_rpcs::methods::chain_head::{ BestBlockChanged, Finalized, FollowEvent, Initialized, NewBlock, }; -use futures::stream::{FuturesUnordered, Stream, StreamExt}; use std::collections::{HashMap, HashSet}; use std::future::Future; diff --git a/subxt/src/backend/chain_head/mod.rs b/subxt/src/backend/chain_head/mod.rs index 66b60f42cc..4f78d2882e 100644 --- a/subxt/src/backend/chain_head/mod.rs +++ b/subxt/src/backend/chain_head/mod.rs @@ -16,14 +16,10 @@ mod follow_stream_driver; mod follow_stream_unpin; mod storage_items; -use subxt_rpcs::RpcClient; -use subxt_rpcs::methods::chain_head::{ - FollowEvent, MethodResponse, RuntimeEvent, StorageQuery, StorageQueryType, StorageResultType, -}; use self::follow_stream_driver::FollowStreamFinalizedHeads; use crate::backend::{ - utils::retry, Backend, BlockRef, BlockRefT, RuntimeVersion, StorageResponse, - StreamOf, StreamOfResults, TransactionStatus, + utils::retry, Backend, BlockRef, BlockRefT, RuntimeVersion, StorageResponse, StreamOf, + StreamOfResults, TransactionStatus, }; use crate::config::BlockHash; use crate::error::{Error, RpcError}; @@ -35,6 +31,10 @@ use futures::{Stream, StreamExt}; use std::collections::HashMap; use std::task::Poll; use storage_items::StorageItems; +use subxt_rpcs::methods::chain_head::{ + FollowEvent, MethodResponse, RuntimeEvent, StorageQuery, StorageQueryType, StorageResultType, +}; +use subxt_rpcs::RpcClient; // Expose the RPC methods. pub use subxt_rpcs::methods::chain_head::ChainHeadRpcMethods; @@ -340,7 +340,8 @@ impl Backend for ChainHeadBackend { retry(|| async { let genesis_hash = self.methods.chainspec_v1_genesis_hash().await?; Ok(genesis_hash) - }).await + }) + .await } async fn block_header(&self, at: T::Hash) -> Result, Error> { @@ -670,9 +671,7 @@ impl Backend for ChainHeadBackend { finalized_hash = Some(block.hash); continue; } - RpcTransactionStatus::BestChainBlockIncluded { - block: Some(block), - } => { + RpcTransactionStatus::BestChainBlockIncluded { block: Some(block) } => { // Look up a pinned block ref if we can, else return a non-pinned // block that likely isn't accessible. We have no guarantee that a best // block on the node a tx was sent to will ever be known about on the diff --git a/subxt/src/backend/chain_head/storage_items.rs b/subxt/src/backend/chain_head/storage_items.rs index 22ea4bd930..4194ceaf6a 100644 --- a/subxt/src/backend/chain_head/storage_items.rs +++ b/subxt/src/backend/chain_head/storage_items.rs @@ -6,15 +6,15 @@ use super::follow_stream_driver::FollowStreamDriverHandle; use super::follow_stream_unpin::BlockRef; use crate::config::Config; use crate::error::{Error, RpcError}; -use subxt_rpcs::methods::chain_head::{ - ChainHeadRpcMethods, FollowEvent, MethodResponse, StorageQuery, StorageResult, -}; use futures::{FutureExt, Stream, StreamExt}; use std::collections::VecDeque; use std::future::Future; use std::pin::Pin; use std::sync::Arc; use std::task::{Context, Poll}; +use subxt_rpcs::methods::chain_head::{ + ChainHeadRpcMethods, FollowEvent, MethodResponse, StorageQuery, StorageResult, +}; /// Obtain a stream of storage items given some query. this handles continuing /// and stopping under the hood, and returns a stream of `StorageResult`s. @@ -59,8 +59,10 @@ impl StorageItems { let operation_id = operation_id.clone(); let methods = methods.clone(); - Box::pin(async move { - let cont = methods.chainhead_v1_continue(&sub_id, &operation_id).await?; + Box::pin(async move { + let cont = methods + .chainhead_v1_continue(&sub_id, &operation_id) + .await?; Ok(cont) }) }) diff --git a/subxt/src/backend/legacy.rs b/subxt/src/backend/legacy.rs index 6e253216ef..4e6ae3ee7d 100644 --- a/subxt/src/backend/legacy.rs +++ b/subxt/src/backend/legacy.rs @@ -188,14 +188,16 @@ impl Backend for LegacyBackend { retry(|| async { let hash = self.methods.genesis_hash().await?; Ok(hash) - }).await + }) + .await } async fn block_header(&self, at: T::Hash) -> Result, Error> { retry(|| async { let header = self.methods.chain_get_header(Some(at)).await?; Ok(header) - }).await + }) + .await } async fn block_body(&self, at: T::Hash) -> Result>>, Error> { @@ -237,14 +239,12 @@ impl Backend for LegacyBackend { Box::pin(async move { let sub = methods.state_subscribe_runtime_version().await?; - let sub = sub - .map_err(|e| e.into()) - .map(|r| { - r.map(|v| RuntimeVersion { - spec_version: v.spec_version, - transaction_version: v.transaction_version, - }) - }); + let sub = sub.map_err(|e| e.into()).map(|r| { + r.map(|v| RuntimeVersion { + spec_version: v.spec_version, + transaction_version: v.transaction_version, + }) + }); Ok(StreamOf(Box::pin(sub))) }) }) @@ -277,14 +277,12 @@ impl Backend for LegacyBackend { let methods = methods.clone(); Box::pin(async move { let sub = methods.chain_subscribe_all_heads().await?; - let sub = sub - .map_err(|e| e.into()) - .map(|r| { - r.map(|h| { - let hash = h.hash(); - (h, BlockRef::from_hash(hash)) - }) - }); + let sub = sub.map_err(|e| e.into()).map(|r| { + r.map(|h| { + let hash = h.hash(); + (h, BlockRef::from_hash(hash)) + }) + }); Ok(StreamOf(Box::pin(sub))) }) }) @@ -302,14 +300,12 @@ impl Backend for LegacyBackend { let methods = methods.clone(); Box::pin(async move { let sub = methods.chain_subscribe_new_heads().await?; - let sub = sub - .map_err(|e| e.into()) - .map(|r| { - r.map(|h| { - let hash = h.hash(); - (h, BlockRef::from_hash(hash)) - }) - }); + let sub = sub.map_err(|e| e.into()).map(|r| { + r.map(|h| { + let hash = h.hash(); + (h, BlockRef::from_hash(hash)) + }) + }); Ok(StreamOf(Box::pin(sub))) }) }) @@ -424,9 +420,13 @@ impl Backend for LegacyBackend { at: T::Hash, ) -> Result, Error> { retry(|| async { - let res = self.methods.state_call(method, call_parameters, Some(at)).await?; + let res = self + .methods + .state_call(method, call_parameters, Some(at)) + .await?; Ok(res) - }).await + }) + .await } } @@ -625,11 +625,13 @@ impl Stream for StorageFetchDescendantValuesStream { let at = this.keys.at; let results_fut = async move { let keys = keys.iter().map(|k| &**k); - let values = - retry(|| async { - let res = methods.state_query_storage_at(keys.clone(), Some(at)).await?; - Ok(res) - }).await?; + let values = retry(|| async { + let res = methods + .state_query_storage_at(keys.clone(), Some(at)) + .await?; + Ok(res) + }) + .await?; let values: VecDeque<_> = values .into_iter() .flat_map(|v| { diff --git a/subxt/src/backend/mod.rs b/subxt/src/backend/mod.rs index b167ad7e2b..ea0292f683 100644 --- a/subxt/src/backend/mod.rs +++ b/subxt/src/backend/mod.rs @@ -23,8 +23,10 @@ use std::sync::Arc; /// Some re-exports from the [`subxt_rpcs`] crate, also accessible in full via [`crate::ext::subxt_rpcs`]. pub mod rpc { - pub use subxt_rpcs::{ RpcClient, RpcClientT }; - pub use subxt_rpcs::client::{ RawRpcFuture, RawRpcSubscription, RawValue, reconnecting_rpc_client }; + pub use subxt_rpcs::client::{ + reconnecting_rpc_client, RawRpcFuture, RawRpcSubscription, RawValue, + }; + pub use subxt_rpcs::{RpcClient, RpcClientT}; } /// Prevent the backend trait being implemented externally. @@ -623,7 +625,13 @@ mod test { mod legacy { use super::*; - use crate::{backend::legacy::{rpc_methods::{Bytes, RuntimeVersion}, LegacyBackend}, error::RpcError}; + use crate::{ + backend::legacy::{ + rpc_methods::{Bytes, RuntimeVersion}, + LegacyBackend, + }, + error::RpcError, + }; use rpc_client::*; pub fn setup_mock_rpc() -> MockRpcBuilder { @@ -863,7 +871,9 @@ mod test { } else { assert!(matches!( res, - Err(Error::Rpc(RpcError::ClientError(subxt_rpcs::Error::Client(_)))) + Err(Error::Rpc(RpcError::ClientError( + subxt_rpcs::Error::Client(_) + ))) )) } } @@ -879,9 +889,8 @@ mod test { use futures::task::Poll; use rpc_client::{Message, MockRpcBuilder, Subscription}; use subxt_rpcs::methods::chain_head::{ - self, - Bytes, Initialized, MethodResponse, MethodResponseStarted, OperationError, OperationId, - OperationStorageItems, RuntimeSpec, RuntimeVersionEvent, + self, Bytes, Initialized, MethodResponse, MethodResponseStarted, OperationError, + OperationId, OperationStorageItems, RuntimeSpec, RuntimeVersionEvent, }; use super::chain_head::*; @@ -994,10 +1003,7 @@ mod test { result: chain_head::StorageResultType::Value(Bytes(value.to_owned().into())), } } - fn storage_items( - id: &str, - items: &[chain_head::StorageResult], - ) -> FollowEvent { + fn storage_items(id: &str, items: &[chain_head::StorageResult]) -> FollowEvent { FollowEvent::OperationStorageItems(OperationStorageItems { operation_id: id.to_owned(), items: VecDeque::from(items.to_owned()), @@ -1067,7 +1073,9 @@ mod test { let response_data = vec![ ( "method_response", - Message::Single(Err(subxt_rpcs::Error::DisconnectedWillReconnect("Error".into()))), + Message::Single(Err(subxt_rpcs::Error::DisconnectedWillReconnect( + "Error".into(), + ))), ), ( "method_response", @@ -1160,7 +1168,9 @@ mod test { ("continue_response", Message::Single(Ok(()))), ( "continue_response", - Message::Single(Err(subxt_rpcs::Error::DisconnectedWillReconnect("Error".into()))), + Message::Single(Err(subxt_rpcs::Error::DisconnectedWillReconnect( + "Error".into(), + ))), ), ("continue_response", Message::Single(Ok(()))), ("continue_response", Message::Single(Ok(()))), @@ -1298,7 +1308,9 @@ mod test { ), ( "chainSpec_v1_genesisHash", - Message::Single(Err(subxt_rpcs::Error::DisconnectedWillReconnect("Error".to_owned()))), + Message::Single(Err(subxt_rpcs::Error::DisconnectedWillReconnect( + "Error".to_owned(), + ))), ), ("chainSpec_v1_genesisHash", Message::Single(Ok(hash))), ]; @@ -1332,7 +1344,7 @@ mod test { ), ( "method_response", - Message::Single(Err(subxt_rpcs::Error::Client("stale id".into()))), + Message::Single(Err(subxt_rpcs::Error::Client("stale id".into()))), ), ( "method_response", diff --git a/subxt/src/backend/utils.rs b/subxt/src/backend/utils.rs index 28a89bdf37..b7b003c48e 100644 --- a/subxt/src/backend/utils.rs +++ b/subxt/src/backend/utils.rs @@ -182,9 +182,7 @@ mod tests { use crate::backend::StreamOf; fn disconnect_err() -> Error { - Error::Rpc(subxt_rpcs::Error::DisconnectedWillReconnect( - String::new(), - ).into()) + Error::Rpc(subxt_rpcs::Error::DisconnectedWillReconnect(String::new()).into()) } fn custom_err() -> Error { diff --git a/subxt/src/error/mod.rs b/subxt/src/error/mod.rs index 90f421dd0d..f2e10d46a6 100644 --- a/subxt/src/error/mod.rs +++ b/subxt/src/error/mod.rs @@ -129,7 +129,12 @@ impl From for Error { impl Error { /// Checks whether the error was caused by a RPC re-connection. pub fn is_disconnected_will_reconnect(&self) -> bool { - matches!(self, Error::Rpc(RpcError::ClientError(subxt_rpcs::Error::DisconnectedWillReconnect(_)))) + matches!( + self, + Error::Rpc(RpcError::ClientError( + subxt_rpcs::Error::DisconnectedWillReconnect(_) + )) + ) } /// Checks whether the error was caused by a RPC request being rejected. diff --git a/subxt/src/macros.rs b/subxt/src/macros.rs index 2119361935..2a3b893b70 100644 --- a/subxt/src/macros.rs +++ b/subxt/src/macros.rs @@ -46,9 +46,7 @@ macro_rules! cfg_jsonrpsee_web { } } -pub(crate) use { - cfg_feature, cfg_jsonrpsee, cfg_unstable_light_client, -}; +pub(crate) use {cfg_feature, cfg_jsonrpsee, cfg_unstable_light_client}; // Only used by light-client. #[allow(unused)]