mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 01:01:04 +00:00
Clean up indentation problems (#4762)
This commit is contained in:
@@ -21,10 +21,10 @@ use std::collections::{BTreeMap, HashMap};
|
||||
use std::future::Future;
|
||||
|
||||
use sp_runtime::{
|
||||
traits::{
|
||||
Block as BlockT, Header as HeaderT, NumberFor,
|
||||
},
|
||||
generic::BlockId
|
||||
traits::{
|
||||
Block as BlockT, Header as HeaderT, NumberFor,
|
||||
},
|
||||
generic::BlockId
|
||||
};
|
||||
use sp_core::ChangesTrieConfigurationRange;
|
||||
use sp_state_machine::StorageProof;
|
||||
@@ -307,8 +307,8 @@ pub trait RemoteBlockchain<Block: BlockT>: Send + Sync {
|
||||
pub mod tests {
|
||||
use futures::future::Ready;
|
||||
use parking_lot::Mutex;
|
||||
use sp_blockchain::Error as ClientError;
|
||||
use sp_test_primitives::{Block, Header, Extrinsic};
|
||||
use sp_blockchain::Error as ClientError;
|
||||
use sp_test_primitives::{Block, Header, Extrinsic};
|
||||
use super::*;
|
||||
|
||||
pub type OkCallFetcher = Mutex<Vec<u8>>;
|
||||
|
||||
@@ -65,7 +65,7 @@ use sp_timestamp::{
|
||||
use sc_telemetry::{telemetry, CONSENSUS_TRACE, CONSENSUS_DEBUG, CONSENSUS_INFO};
|
||||
|
||||
use sc_consensus_slots::{
|
||||
CheckedHeader, SlotWorker, SlotInfo, SlotCompatible, StorageChanges, check_equivocation,
|
||||
CheckedHeader, SlotWorker, SlotInfo, SlotCompatible, StorageChanges, check_equivocation,
|
||||
};
|
||||
|
||||
use sc_keystore::KeyStorePtr;
|
||||
|
||||
@@ -72,7 +72,7 @@ fn call_not_existing_function(wasm_method: WasmExecutionMethod) {
|
||||
let mut ext = TestExternalities::default();
|
||||
let mut ext = ext.ext();
|
||||
|
||||
match call_in_wasm(
|
||||
match call_in_wasm(
|
||||
"test_calling_missing_external",
|
||||
&[],
|
||||
wasm_method,
|
||||
|
||||
@@ -708,7 +708,7 @@ fn ignore_error<F, T>(future: F) -> impl std::future::Future<Output=Result<Optio
|
||||
mod tests {
|
||||
use rpc::futures::stream::futures_ordered;
|
||||
use substrate_test_runtime_client::runtime::Block;
|
||||
use sp_core::H256;
|
||||
use sp_core::H256;
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1163,7 +1163,7 @@ ServiceBuilder<
|
||||
).map(drop);
|
||||
|
||||
let _ = to_spawn_tx.unbounded_send((Box::pin(future), From::from("grafana-server")));
|
||||
}
|
||||
}
|
||||
|
||||
// Instrumentation
|
||||
if let Some(tracing_targets) = config.tracing_targets.as_ref() {
|
||||
|
||||
@@ -153,7 +153,7 @@ fn bench_configured(pool: Pool<TestApi>, number: u64) {
|
||||
|
||||
fn benchmark_main(c: &mut Criterion) {
|
||||
|
||||
c.bench_function("sequential 50 tx", |b| {
|
||||
c.bench_function("sequential 50 tx", |b| {
|
||||
b.iter(|| {
|
||||
bench_configured(Pool::new(Default::default(), TestApi::new_dependant().into()), 50);
|
||||
});
|
||||
|
||||
@@ -76,7 +76,7 @@ impl<'a> ContractModule<'a> {
|
||||
|
||||
/// Ensures that tables declared in the module are not too big.
|
||||
fn ensure_table_size_limit(&self, limit: u32) -> Result<(), &'static str> {
|
||||
if let Some(table_section) = self.module.table_section() {
|
||||
if let Some(table_section) = self.module.table_section() {
|
||||
// In Wasm MVP spec, there may be at most one table declared. Double check this
|
||||
// explicitly just in case the Wasm version changes.
|
||||
if table_section.entries().len() > 1 {
|
||||
|
||||
@@ -73,8 +73,8 @@ fn bench_division(c: &mut Criterion) {
|
||||
}
|
||||
|
||||
criterion_group!{
|
||||
name = benches;
|
||||
config = Criterion::default();
|
||||
targets = bench_addition, bench_subtraction, bench_multiplication, bench_division
|
||||
name = benches;
|
||||
config = Criterion::default();
|
||||
targets = bench_addition, bench_subtraction, bench_multiplication, bench_division
|
||||
}
|
||||
criterion_main!(benches);
|
||||
|
||||
@@ -87,8 +87,8 @@ fn bench_ed25519(c: &mut Criterion) {
|
||||
}
|
||||
|
||||
criterion_group!{
|
||||
name = benches;
|
||||
config = Criterion::default().warm_up_time(Duration::from_millis(500)).without_plots();
|
||||
targets = bench_hash_128_fix_size, bench_hash_128_dyn_size, bench_ed25519
|
||||
name = benches;
|
||||
config = Criterion::default().warm_up_time(Duration::from_millis(500)).without_plots();
|
||||
targets = bench_hash_128_fix_size, bench_hash_128_dyn_size, bench_ed25519
|
||||
}
|
||||
criterion_main!(benches);
|
||||
|
||||
@@ -158,8 +158,8 @@ fn do_phragmen(
|
||||
macro_rules! phragmen_benches {
|
||||
($($name:ident: $tup:expr,)*) => {
|
||||
$(
|
||||
#[bench]
|
||||
fn $name(b: &mut Bencher) {
|
||||
#[bench]
|
||||
fn $name(b: &mut Bencher) {
|
||||
let (v, n, t, e, eq_iter, eq_tol) = $tup;
|
||||
println!("----------------------");
|
||||
println!(
|
||||
@@ -168,8 +168,8 @@ macro_rules! phragmen_benches {
|
||||
v, n, e, e * n, t, eq_iter, eq_tol,
|
||||
);
|
||||
do_phragmen(b, v, n, t, e, eq_iter, eq_tol);
|
||||
}
|
||||
)*
|
||||
}
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,14 +47,14 @@ pub enum Era {
|
||||
}
|
||||
|
||||
/*
|
||||
E.g. with period == 4:
|
||||
0 10 20 30 40
|
||||
0123456789012345678901234567890123456789012
|
||||
|...|
|
||||
authored -/ \- expiry
|
||||
phase = 1
|
||||
n = Q(current - phase, period) + phase
|
||||
*/
|
||||
* E.g. with period == 4:
|
||||
* 0 10 20 30 40
|
||||
* 0123456789012345678901234567890123456789012
|
||||
* |...|
|
||||
* authored -/ \- expiry
|
||||
* phase = 1
|
||||
* n = Q(current - phase, period) + phase
|
||||
*/
|
||||
impl Era {
|
||||
/// Create a new era based on a period (which should be a power of two between 4 and 65536 inclusive)
|
||||
/// and a block number on which it should start (or, for long periods, be shortly after the start).
|
||||
|
||||
@@ -21,42 +21,42 @@ use std::time::{Instant, Duration};
|
||||
/// Measured count of operations and total bytes.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct UsageUnit {
|
||||
/// Number of operations.
|
||||
pub ops: u64,
|
||||
/// Number of bytes.
|
||||
pub bytes: u64,
|
||||
/// Number of operations.
|
||||
pub ops: u64,
|
||||
/// Number of bytes.
|
||||
pub bytes: u64,
|
||||
}
|
||||
|
||||
/// Usage statistics for state backend.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct UsageInfo {
|
||||
/// Read statistics (total).
|
||||
pub reads: UsageUnit,
|
||||
/// Write statistics.
|
||||
pub writes: UsageUnit,
|
||||
/// Cache read statistics.
|
||||
pub cache_reads: UsageUnit,
|
||||
/// Memory used.
|
||||
pub memory: usize,
|
||||
/// Read statistics (total).
|
||||
pub reads: UsageUnit,
|
||||
/// Write statistics.
|
||||
pub writes: UsageUnit,
|
||||
/// Cache read statistics.
|
||||
pub cache_reads: UsageUnit,
|
||||
/// Memory used.
|
||||
pub memory: usize,
|
||||
|
||||
/// Moment at which current statistics has been started being collected.
|
||||
pub started: Instant,
|
||||
/// Timespan of the statistics.
|
||||
pub span: Duration,
|
||||
/// Moment at which current statistics has been started being collected.
|
||||
pub started: Instant,
|
||||
/// Timespan of the statistics.
|
||||
pub span: Duration,
|
||||
}
|
||||
|
||||
impl UsageInfo {
|
||||
/// Empty statistics.
|
||||
///
|
||||
/// Means no data was collected.
|
||||
pub fn empty() -> Self {
|
||||
Self {
|
||||
reads: UsageUnit::default(),
|
||||
writes: UsageUnit::default(),
|
||||
cache_reads: UsageUnit::default(),
|
||||
memory: 0,
|
||||
started: Instant::now(),
|
||||
span: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Empty statistics.
|
||||
///
|
||||
/// Means no data was collected.
|
||||
pub fn empty() -> Self {
|
||||
Self {
|
||||
reads: UsageUnit::default(),
|
||||
writes: UsageUnit::default(),
|
||||
cache_reads: UsageUnit::default(),
|
||||
memory: 0,
|
||||
started: Instant::now(),
|
||||
span: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user