mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Run cargo fmt on the whole code base (#9394)
* Run cargo fmt on the whole code base * Second run * Add CI check * Fix compilation * More unnecessary braces * Handle weights * Use --all * Use correct attributes... * Fix UI tests * AHHHHHHHHH * 🤦 * Docs * Fix compilation * 🤷 * Please stop * 🤦 x 2 * More * make rustfmt.toml consistent with polkadot Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
@@ -20,16 +20,14 @@
|
||||
|
||||
#![warn(missing_docs)]
|
||||
|
||||
use codec::{DecodeAll, FullCodec, FullEncode};
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::storage::generator::{StorageDoubleMap, StorageMap, StorageValue};
|
||||
use futures::compat::Future01CompatExt;
|
||||
use jsonrpc_client_transports::RpcError;
|
||||
use codec::{DecodeAll, FullCodec, FullEncode};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use frame_support::storage::generator::{
|
||||
StorageDoubleMap, StorageMap, StorageValue
|
||||
};
|
||||
use sp_storage::{StorageData, StorageKey};
|
||||
use sc_rpc_api::state::StateClient;
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use sp_storage::{StorageData, StorageKey};
|
||||
|
||||
/// A typed query on chain state usable from an RPC client.
|
||||
///
|
||||
@@ -54,7 +52,7 @@ use sc_rpc_api::state::StateClient;
|
||||
/// # struct TestRuntime;
|
||||
/// #
|
||||
/// # decl_module! {
|
||||
/// # pub struct Module<T: Config> for enum Call where origin: T::Origin {}
|
||||
/// # pub struct Module<T: Config> for enum Call where origin: T::Origin {}
|
||||
/// # }
|
||||
/// #
|
||||
/// pub type Loc = (i64, i64, i64);
|
||||
@@ -98,18 +96,12 @@ pub struct StorageQuery<V> {
|
||||
impl<V: FullCodec> StorageQuery<V> {
|
||||
/// Create a storage query for a StorageValue.
|
||||
pub fn value<St: StorageValue<V>>() -> Self {
|
||||
Self {
|
||||
key: StorageKey(St::storage_value_final_key().to_vec()),
|
||||
_spook: PhantomData,
|
||||
}
|
||||
Self { key: StorageKey(St::storage_value_final_key().to_vec()), _spook: PhantomData }
|
||||
}
|
||||
|
||||
/// Create a storage query for a value in a StorageMap.
|
||||
pub fn map<St: StorageMap<K, V>, K: FullEncode>(key: K) -> Self {
|
||||
Self {
|
||||
key: StorageKey(St::storage_map_final_key(key)),
|
||||
_spook: PhantomData,
|
||||
}
|
||||
Self { key: StorageKey(St::storage_map_final_key(key)), _spook: PhantomData }
|
||||
}
|
||||
|
||||
/// Create a storage query for a value in a StorageDoubleMap.
|
||||
@@ -117,10 +109,7 @@ impl<V: FullCodec> StorageQuery<V> {
|
||||
key1: K1,
|
||||
key2: K2,
|
||||
) -> Self {
|
||||
Self {
|
||||
key: StorageKey(St::storage_double_map_final_key(key1, key2)),
|
||||
_spook: PhantomData,
|
||||
}
|
||||
Self { key: StorageKey(St::storage_double_map_final_key(key1, key2)), _spook: PhantomData }
|
||||
}
|
||||
|
||||
/// Send this query over RPC, await the typed result.
|
||||
|
||||
Reference in New Issue
Block a user