Reformat imports to a consistent style for imports

rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
This commit is contained in:
Michael Vines
2021-12-03 09:00:31 -08:00
parent 0ef1b25e4b
commit b8837c04ec
397 changed files with 5990 additions and 5175 deletions

View File

@ -3,42 +3,44 @@
/// All tests must start from an entry point and a funding keypair and
/// discover the rest of the network.
use log::*;
use rand::{thread_rng, Rng};
use rayon::prelude::*;
use solana_client::thin_client::create_client;
use solana_core::consensus::VOTE_THRESHOLD_DEPTH;
use solana_entry::entry::{Entry, EntrySlice};
use solana_gossip::{
cluster_info::{self, VALIDATOR_PORT_RANGE},
contact_info::ContactInfo,
crds_value::{self, CrdsData, CrdsValue},
gossip_error::GossipError,
gossip_service::discover_cluster,
};
use solana_ledger::blockstore::Blockstore;
use solana_sdk::{
client::SyncClient,
clock::{self, Slot, NUM_CONSECUTIVE_LEADER_SLOTS},
commitment_config::CommitmentConfig,
epoch_schedule::MINIMUM_SLOTS_PER_EPOCH,
exit::Exit,
hash::Hash,
poh_config::PohConfig,
pubkey::Pubkey,
signature::{Keypair, Signature, Signer},
system_transaction,
timing::{duration_as_ms, timestamp},
transport::TransportError,
};
use solana_streamer::socket::SocketAddrSpace;
use solana_vote_program::vote_transaction;
use std::{
collections::{HashMap, HashSet},
net::SocketAddr,
path::Path,
sync::{Arc, RwLock},
thread::sleep,
time::{Duration, Instant},
use {
rand::{thread_rng, Rng},
rayon::prelude::*,
solana_client::thin_client::create_client,
solana_core::consensus::VOTE_THRESHOLD_DEPTH,
solana_entry::entry::{Entry, EntrySlice},
solana_gossip::{
cluster_info::{self, VALIDATOR_PORT_RANGE},
contact_info::ContactInfo,
crds_value::{self, CrdsData, CrdsValue},
gossip_error::GossipError,
gossip_service::discover_cluster,
},
solana_ledger::blockstore::Blockstore,
solana_sdk::{
client::SyncClient,
clock::{self, Slot, NUM_CONSECUTIVE_LEADER_SLOTS},
commitment_config::CommitmentConfig,
epoch_schedule::MINIMUM_SLOTS_PER_EPOCH,
exit::Exit,
hash::Hash,
poh_config::PohConfig,
pubkey::Pubkey,
signature::{Keypair, Signature, Signer},
system_transaction,
timing::{duration_as_ms, timestamp},
transport::TransportError,
},
solana_streamer::socket::SocketAddrSpace,
solana_vote_program::vote_transaction,
std::{
collections::{HashMap, HashSet},
net::SocketAddr,
path::Path,
sync::{Arc, RwLock},
thread::sleep,
time::{Duration, Instant},
},
};
/// Spend and verify from every node in the network

View File

@ -22,8 +22,7 @@ use {
ValidatorVoteKeypairs,
},
solana_sdk::{
account::Account,
account::AccountSharedData,
account::{Account, AccountSharedData},
client::SyncClient,
clock::{DEFAULT_DEV_SLOTS_PER_EPOCH, DEFAULT_TICKS_PER_SLOT},
commitment_config::CommitmentConfig,
@ -759,8 +758,7 @@ impl Drop for LocalCluster {
#[cfg(test)]
mod test {
use super::*;
use solana_sdk::epoch_schedule::MINIMUM_SLOTS_PER_EPOCH;
use {super::*, solana_sdk::epoch_schedule::MINIMUM_SLOTS_PER_EPOCH};
#[test]
fn test_local_cluster_start_and_exit() {

View File

@ -1,13 +1,15 @@
use crate::{cluster::Cluster, local_cluster::LocalCluster};
use log::*;
use solana_runtime::{
snapshot_archive_info::{
FullSnapshotArchiveInfo, IncrementalSnapshotArchiveInfo, SnapshotArchiveInfoGetter,
use {
crate::{cluster::Cluster, local_cluster::LocalCluster},
log::*,
solana_runtime::{
snapshot_archive_info::{
FullSnapshotArchiveInfo, IncrementalSnapshotArchiveInfo, SnapshotArchiveInfoGetter,
},
snapshot_utils,
},
snapshot_utils,
solana_sdk::{client::SyncClient, commitment_config::CommitmentConfig},
std::{path::Path, thread::sleep, time::Duration},
};
use solana_sdk::{client::SyncClient, commitment_config::CommitmentConfig};
use std::{path::Path, thread::sleep, time::Duration};
impl LocalCluster {
/// Return the next full snapshot archive info after the cluster's last processed slot

View File

@ -1,6 +1,8 @@
use solana_core::validator::ValidatorConfig;
use solana_sdk::exit::Exit;
use std::sync::{Arc, RwLock};
use {
solana_core::validator::ValidatorConfig,
solana_sdk::exit::Exit,
std::sync::{Arc, RwLock},
};
pub fn safe_clone_config(config: &ValidatorConfig) -> ValidatorConfig {
ValidatorConfig {

View File

@ -32,8 +32,7 @@ use {
ancestor_iterator::AncestorIterator,
blockstore::{Blockstore, PurgeType},
blockstore_db::AccessType,
leader_schedule::FixedSchedule,
leader_schedule::LeaderSchedule,
leader_schedule::{FixedSchedule, LeaderSchedule},
},
solana_local_cluster::{
cluster::{Cluster, ClusterValidatorInfo},
@ -68,8 +67,10 @@ use {
io::Read,
iter,
path::{Path, PathBuf},
sync::atomic::{AtomicBool, Ordering},
sync::Arc,
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
thread::{sleep, Builder, JoinHandle},
time::{Duration, Instant},
},