cargo fmt with stable defaults (#876)

This commit is contained in:
James Wilson
2023-03-21 16:53:47 +00:00
committed by GitHub
parent c63ff6ec6d
commit 7c252fccf7
110 changed files with 663 additions and 1949 deletions
+2 -10
View File
@@ -11,17 +11,9 @@
mod offline_client;
mod online_client;
pub use offline_client::{
OfflineClient,
OfflineClientT,
};
pub use offline_client::{OfflineClient, OfflineClientT};
pub use online_client::{
ClientRuntimeUpdater,
OnlineClient,
OnlineClientT,
RuntimeUpdaterStream,
Update,
UpgradeError,
ClientRuntimeUpdater, OnlineClient, OnlineClientT, RuntimeUpdaterStream, Update, UpgradeError,
};
#[cfg(any(
+3 -9
View File
@@ -3,15 +3,9 @@
// see LICENSE for license details.
use crate::{
blocks::BlocksClient,
constants::ConstantsClient,
events::EventsClient,
rpc::types::RuntimeVersion,
runtime_api::RuntimeApiClient,
storage::StorageClient,
tx::TxClient,
Config,
Metadata,
blocks::BlocksClient, constants::ConstantsClient, events::EventsClient,
rpc::types::RuntimeVersion, runtime_api::RuntimeApiClient, storage::StorageClient,
tx::TxClient, Config, Metadata,
};
use derivative::Derivative;
use std::sync::Arc;
+10 -38
View File
@@ -2,33 +2,22 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
use super::{
OfflineClient,
OfflineClientT,
};
use super::{OfflineClient, OfflineClientT};
use crate::{
blocks::BlocksClient,
constants::ConstantsClient,
error::Error,
events::EventsClient,
rpc::{
types::{
RuntimeVersion,
Subscription,
},
Rpc,
RpcClientT,
types::{RuntimeVersion, Subscription},
Rpc, RpcClientT,
},
runtime_api::RuntimeApiClient,
storage::StorageClient,
tx::TxClient,
Config,
Metadata,
};
use codec::{
Compact,
Decode,
Config, Metadata,
};
use codec::{Compact, Decode};
use derivative::Derivative;
use frame_metadata::RuntimeMetadataPrefixed;
use futures::future;
@@ -114,12 +103,7 @@ impl<T: Config> OnlineClient<T> {
)
.await;
OnlineClient::from_rpc_client_with(
genesis_hash?,
runtime_version?,
metadata?,
rpc_client,
)
OnlineClient::from_rpc_client_with(genesis_hash?, runtime_version?, metadata?, rpc_client)
}
/// Construct a new [`OnlineClient`] by providing all of the underlying details needed
@@ -341,7 +325,7 @@ impl<T: Config> ClientRuntimeUpdater<T> {
/// Tries to apply a new update.
pub fn apply_update(&self, update: Update) -> Result<(), UpgradeError> {
if !self.is_runtime_version_different(&update.runtime_version) {
return Err(UpgradeError::SameVersion)
return Err(UpgradeError::SameVersion);
}
self.do_update(update);
@@ -442,18 +426,9 @@ impl Update {
#[cfg(feature = "jsonrpsee-ws")]
mod jsonrpsee_helpers {
pub use jsonrpsee::{
client_transport::ws::{
InvalidUri,
Receiver,
Sender,
Uri,
WsTransportClientBuilder,
},
client_transport::ws::{InvalidUri, Receiver, Sender, Uri, WsTransportClientBuilder},
core::{
client::{
Client,
ClientBuilder,
},
client::{Client, ClientBuilder},
Error,
},
};
@@ -483,10 +458,7 @@ mod jsonrpsee_helpers {
pub use jsonrpsee::{
client_transport::web,
core::{
client::{
Client,
ClientBuilder,
},
client::{Client, ClientBuilder},
Error,
},
};