diff --git a/runtime/benches/accounts.rs b/runtime/benches/accounts.rs index be1a8c85fb..5520366a17 100644 --- a/runtime/benches/accounts.rs +++ b/runtime/benches/accounts.rs @@ -2,11 +2,11 @@ extern crate test; -use solana_runtime::accounts::{create_test_accounts, Accounts}; -use solana_runtime::bank::*; -use solana_sdk::account::Account; -use solana_sdk::genesis_config::create_genesis_config; -use solana_sdk::pubkey::Pubkey; +use solana_runtime::{ + accounts::{create_test_accounts, Accounts}, + bank::*, +}; +use solana_sdk::{account::Account, genesis_config::create_genesis_config, pubkey::Pubkey}; use std::{path::PathBuf, sync::Arc}; use test::Bencher; diff --git a/runtime/benches/accounts_index.rs b/runtime/benches/accounts_index.rs index 88b5cbf230..033ffd4cc2 100644 --- a/runtime/benches/accounts_index.rs +++ b/runtime/benches/accounts_index.rs @@ -3,8 +3,7 @@ extern crate test; use rand::{thread_rng, Rng}; -use solana_runtime::accounts_db::AccountInfo; -use solana_runtime::accounts_index::AccountsIndex; +use solana_runtime::{accounts_db::AccountInfo, accounts_index::AccountsIndex}; use solana_sdk::pubkey::Pubkey; use test::Bencher; diff --git a/runtime/benches/append_vec.rs b/runtime/benches/append_vec.rs index b339011a9d..e701216a91 100644 --- a/runtime/benches/append_vec.rs +++ b/runtime/benches/append_vec.rs @@ -2,13 +2,17 @@ extern crate test; use rand::{thread_rng, Rng}; -use solana_runtime::append_vec::test_utils::{create_test_account, get_append_vec_path}; -use solana_runtime::append_vec::AppendVec; +use solana_runtime::append_vec::{ + test_utils::{create_test_account, get_append_vec_path}, + AppendVec, +}; use solana_sdk::hash::Hash; -use std::sync::{Arc, Mutex}; -use std::thread::sleep; -use std::thread::spawn; -use std::time::Duration; +use std::{ + sync::{Arc, Mutex}, + thread::sleep, + thread::spawn, + time::Duration, +}; use test::Bencher; #[bench] diff --git a/runtime/benches/bank.rs b/runtime/benches/bank.rs index 17244efbae..9a3c83935e 100644 --- a/runtime/benches/bank.rs +++ b/runtime/benches/bank.rs @@ -3,21 +3,19 @@ extern crate test; use log::*; -use solana_runtime::bank::*; -use solana_runtime::bank_client::BankClient; -use solana_runtime::loader_utils::create_invoke_instruction; -use solana_sdk::account::KeyedAccount; -use solana_sdk::client::AsyncClient; -use solana_sdk::client::SyncClient; -use solana_sdk::clock::MAX_RECENT_BLOCKHASHES; -use solana_sdk::genesis_config::create_genesis_config; -use solana_sdk::instruction::InstructionError; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::{Keypair, KeypairUtil}; -use solana_sdk::transaction::Transaction; -use std::sync::Arc; -use std::thread::sleep; -use std::time::Duration; +use solana_runtime::{bank::*, bank_client::BankClient, loader_utils::create_invoke_instruction}; +use solana_sdk::{ + account::KeyedAccount, + client::AsyncClient, + client::SyncClient, + clock::MAX_RECENT_BLOCKHASHES, + genesis_config::create_genesis_config, + instruction::InstructionError, + pubkey::Pubkey, + signature::{Keypair, KeypairUtil}, + transaction::Transaction, +}; +use std::{sync::Arc, thread::sleep, time::Duration}; use test::Bencher; const BUILTIN_PROGRAM_ID: [u8; 32] = [ diff --git a/runtime/benches/bloom.rs b/runtime/benches/bloom.rs index cd71b88367..9b227a3b10 100644 --- a/runtime/benches/bloom.rs +++ b/runtime/benches/bloom.rs @@ -4,8 +4,10 @@ extern crate test; use bv::BitVec; use fnv::FnvHasher; use solana_runtime::bloom::{Bloom, BloomHashIndex}; -use solana_sdk::hash::{hash, Hash}; -use solana_sdk::signature::Signature; +use solana_sdk::{ + hash::{hash, Hash}, + signature::Signature, +}; use std::collections::HashSet; use std::hash::Hasher; use test::Bencher; diff --git a/runtime/benches/status_cache.rs b/runtime/benches/status_cache.rs index 2903f3dc42..36c1edbabd 100644 --- a/runtime/benches/status_cache.rs +++ b/runtime/benches/status_cache.rs @@ -4,8 +4,10 @@ extern crate test; use bincode::serialize; use solana_runtime::status_cache::*; -use solana_sdk::hash::{hash, Hash}; -use solana_sdk::signature::Signature; +use solana_sdk::{ + hash::{hash, Hash}, + signature::Signature, +}; use test::Bencher; type BankStatusCache = StatusCache<()>; diff --git a/runtime/benches/transaction_utils.rs b/runtime/benches/transaction_utils.rs index 000b06d951..ad5b1667e1 100644 --- a/runtime/benches/transaction_utils.rs +++ b/runtime/benches/transaction_utils.rs @@ -2,8 +2,7 @@ extern crate test; -use rand::seq::SliceRandom; -use rand::thread_rng; +use rand::{seq::SliceRandom, thread_rng}; use solana_runtime::transaction_utils::OrderedIterator; use test::Bencher; diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index cc7db33b13..c55e9b18b8 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -1,30 +1,35 @@ -use crate::accounts_db::{ - AccountInfo, AccountStorage, AccountsDB, AppendVecId, BankHashInfo, ErrorCounters, +use crate::{ + accounts_db::{ + AccountInfo, AccountStorage, AccountsDB, AppendVecId, BankHashInfo, ErrorCounters, + }, + accounts_index::AccountsIndex, + append_vec::StoredAccount, + bank::{HashAgeKind, TransactionProcessResult}, + blockhash_queue::BlockhashQueue, + nonce_utils::prepare_if_nonce_account, + rent_collector::RentCollector, + system_instruction_processor::{get_system_account_kind, SystemAccountKind}, + transaction_utils::OrderedIterator, }; -use crate::accounts_index::AccountsIndex; -use crate::append_vec::StoredAccount; -use crate::bank::{HashAgeKind, TransactionProcessResult}; -use crate::blockhash_queue::BlockhashQueue; -use crate::nonce_utils::prepare_if_nonce_account; -use crate::rent_collector::RentCollector; -use crate::system_instruction_processor::{get_system_account_kind, SystemAccountKind}; use log::*; use rayon::slice::ParallelSliceMut; -use solana_sdk::account::Account; -use solana_sdk::bank_hash::BankHash; -use solana_sdk::clock::Slot; -use solana_sdk::hash::Hash; -use solana_sdk::native_loader; -use solana_sdk::nonce_state::NonceState; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::transaction::Result; -use solana_sdk::transaction::{Transaction, TransactionError}; -use std::collections::{HashMap, HashSet}; -use std::io::{BufReader, Error as IOError, Read}; -use std::path::{Path, PathBuf}; -use std::sync::{Arc, Mutex, RwLock}; - -use crate::transaction_utils::OrderedIterator; +use solana_sdk::{ + account::Account, + bank_hash::BankHash, + clock::Slot, + hash::Hash, + native_loader, + nonce_state::NonceState, + pubkey::Pubkey, + transaction::Result, + transaction::{Transaction, TransactionError}, +}; +use std::{ + collections::{HashMap, HashSet}, + io::{BufReader, Error as IOError, Read}, + path::{Path, PathBuf}, + sync::{Arc, Mutex, RwLock}, +}; #[derive(Default, Debug)] struct ReadonlyLock { @@ -648,26 +653,34 @@ mod tests { // TODO: all the bank tests are bank specific, issue: 2194 use super::*; - use crate::accounts_db::tests::copy_append_vecs; - use crate::accounts_db::{get_temp_accounts_paths, AccountsDBSerialize}; - use crate::bank::HashAgeKind; - use crate::rent_collector::RentCollector; + use crate::{ + accounts_db::{ + tests::copy_append_vecs, + {get_temp_accounts_paths, AccountsDBSerialize}, + }, + bank::HashAgeKind, + rent_collector::RentCollector, + }; use bincode::serialize_into; use rand::{thread_rng, Rng}; - use solana_sdk::account::Account; - use solana_sdk::epoch_schedule::EpochSchedule; - use solana_sdk::fee_calculator::FeeCalculator; - use solana_sdk::hash::Hash; - use solana_sdk::instruction::CompiledInstruction; - use solana_sdk::message::Message; - use solana_sdk::nonce_state; - use solana_sdk::rent::Rent; - use solana_sdk::signature::{Keypair, KeypairUtil}; - use solana_sdk::system_program; - use solana_sdk::transaction::Transaction; - use std::io::Cursor; - use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; - use std::{thread, time}; + use solana_sdk::{ + account::Account, + epoch_schedule::EpochSchedule, + fee_calculator::FeeCalculator, + hash::Hash, + instruction::CompiledInstruction, + message::Message, + nonce_state, + rent::Rent, + signature::{Keypair, KeypairUtil}, + system_program, + transaction::Transaction, + }; + use std::{ + io::Cursor, + sync::atomic::{AtomicBool, AtomicU64, Ordering}, + {thread, time}, + }; use tempfile::TempDir; fn load_accounts_with_fee_and_rent( diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index abf56ef8a9..cfd4282f81 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -18,33 +18,39 @@ //! tracks the number of commits to the entire data store. So the latest //! commit for each slot entry would be indexed. -use crate::accounts_index::AccountsIndex; -use crate::append_vec::{AppendVec, StoredAccount, StoredMeta}; -use crate::bank::deserialize_from_snapshot; +use crate::{ + accounts_index::AccountsIndex, + append_vec::{AppendVec, StoredAccount, StoredMeta}, + bank::deserialize_from_snapshot, +}; use bincode::{deserialize_from, serialize_into}; use byteorder::{ByteOrder, LittleEndian}; use fs_extra::dir::CopyOptions; use log::*; use rand::{thread_rng, Rng}; -use rayon::prelude::*; -use rayon::ThreadPool; -use serde::de::{MapAccess, Visitor}; -use serde::ser::{SerializeMap, Serializer}; -use serde::{Deserialize, Serialize}; +use rayon::{prelude::*, ThreadPool}; +use serde::{ + de::{MapAccess, Visitor}, + ser::{SerializeMap, Serializer}, + Deserialize, Serialize, +}; use solana_measure::measure::Measure; use solana_rayon_threadlimit::get_thread_count; -use solana_sdk::account::Account; -use solana_sdk::bank_hash::BankHash; -use solana_sdk::clock::{Epoch, Slot}; -use solana_sdk::hash::{Hash, Hasher}; -use solana_sdk::pubkey::Pubkey; -use std::collections::{HashMap, HashSet}; -use std::fmt; -use std::io::{BufReader, Cursor, Error as IOError, ErrorKind, Read, Result as IOResult}; -use std::path::Path; -use std::path::PathBuf; -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::{Arc, RwLock}; +use solana_sdk::{ + account::Account, + bank_hash::BankHash, + clock::{Epoch, Slot}, + hash::{Hash, Hasher}, + pubkey::Pubkey, +}; +use std::{ + collections::{HashMap, HashSet}, + fmt, + io::{BufReader, Cursor, Error as IOError, ErrorKind, Read, Result as IOResult}, + path::{Path, PathBuf}, + sync::atomic::{AtomicUsize, Ordering}, + sync::{Arc, RwLock}, +}; use tempfile::TempDir; pub const DEFAULT_FILE_SIZE: u64 = 4 * 1024 * 1024; @@ -1320,10 +1326,8 @@ pub mod tests { use assert_matches::assert_matches; use bincode::serialize_into; use rand::{thread_rng, Rng}; - use solana_sdk::account::Account; - use solana_sdk::hash::HASH_BYTES; - use std::fs; - use std::str::FromStr; + use solana_sdk::{account::Account, hash::HASH_BYTES}; + use std::{fs, str::FromStr}; use tempfile::TempDir; #[test] diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 4477eb3643..ff4bd6e931 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -1,6 +1,8 @@ use solana_sdk::pubkey::Pubkey; -use std::collections::{HashMap, HashSet}; -use std::sync::{RwLock, RwLockReadGuard}; +use std::{ + collections::{HashMap, HashSet}, + sync::{RwLock, RwLockReadGuard}, +}; pub type Slot = u64; type SlotList = Vec<(Slot, T)>; diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index c355269e18..9b74fce242 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -2188,29 +2188,27 @@ impl From for Bank { mod tests { use super::*; use crate::{ - accounts_db::get_temp_accounts_paths, - accounts_db::tests::copy_append_vecs, + accounts_db::{get_temp_accounts_paths, tests::copy_append_vecs}, genesis_utils::{ create_genesis_config_with_leader, GenesisConfigInfo, BOOTSTRAP_VALIDATOR_LAMPORTS, }, status_cache::MAX_CACHE_ENTRIES, }; use bincode::{serialize_into, serialized_size}; - use solana_sdk::instruction::AccountMeta; - use solana_sdk::system_program::solana_system_program; use solana_sdk::{ account::KeyedAccount, account_utils::StateMut, clock::DEFAULT_TICKS_PER_SLOT, epoch_schedule::MINIMUM_SLOTS_PER_EPOCH, genesis_config::create_genesis_config, - instruction::{CompiledInstruction, Instruction, InstructionError}, + instruction::{AccountMeta, CompiledInstruction, Instruction, InstructionError}, message::{Message, MessageHeader}, nonce_state, poh_config::PohConfig, rent::Rent, signature::{Keypair, KeypairUtil}, - system_instruction, system_program, + system_instruction, + system_program::{self, solana_system_program}, sysvar::{fees::Fees, rewards::Rewards}, timing::duration_as_s, }; diff --git a/runtime/src/bank_client.rs b/runtime/src/bank_client.rs index 24040ddb9a..e033c45fe5 100644 --- a/runtime/src/bank_client.rs +++ b/runtime/src/bank_client.rs @@ -274,8 +274,7 @@ impl BankClient { #[cfg(test)] mod tests { use super::*; - use solana_sdk::genesis_config::create_genesis_config; - use solana_sdk::instruction::AccountMeta; + use solana_sdk::{genesis_config::create_genesis_config, instruction::AccountMeta}; #[test] fn test_bank_client_new_with_keypairs() { diff --git a/runtime/src/blockhash_queue.rs b/runtime/src/blockhash_queue.rs index a0c3863899..71fc6cce44 100644 --- a/runtime/src/blockhash_queue.rs +++ b/runtime/src/blockhash_queue.rs @@ -1,7 +1,5 @@ use serde::{Deserialize, Serialize}; -use solana_sdk::fee_calculator::FeeCalculator; -use solana_sdk::hash::Hash; -use solana_sdk::timing::timestamp; +use solana_sdk::{fee_calculator::FeeCalculator, hash::Hash, timing::timestamp}; use std::collections::HashMap; #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] @@ -122,8 +120,7 @@ impl BlockhashQueue { mod tests { use super::*; use bincode::serialize; - use solana_sdk::clock::MAX_RECENT_BLOCKHASHES; - use solana_sdk::hash::hash; + use solana_sdk::{clock::MAX_RECENT_BLOCKHASHES, hash::hash}; #[test] fn test_register_hash() { diff --git a/runtime/src/bloom.rs b/runtime/src/bloom.rs index 95f3be37f5..f9a212bdf0 100644 --- a/runtime/src/bloom.rs +++ b/runtime/src/bloom.rs @@ -3,9 +3,7 @@ use bv::BitVec; use fnv::FnvHasher; use rand::{self, Rng}; use serde::{Deserialize, Serialize}; -use std::cmp; -use std::hash::Hasher; -use std::marker::PhantomData; +use std::{cmp, hash::Hasher, marker::PhantomData}; /// Generate a stable hash of `self` for each `hash_index` /// Best effort can be made for uniqueness of each hash. diff --git a/runtime/src/loader_utils.rs b/runtime/src/loader_utils.rs index 85d226a85c..4bee94d3cb 100644 --- a/runtime/src/loader_utils.rs +++ b/runtime/src/loader_utils.rs @@ -1,11 +1,13 @@ use serde::Serialize; -use solana_sdk::client::Client; -use solana_sdk::instruction::{AccountMeta, Instruction}; -use solana_sdk::loader_instruction; -use solana_sdk::message::Message; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::{Keypair, KeypairUtil}; -use solana_sdk::system_instruction; +use solana_sdk::{ + client::Client, + instruction::{AccountMeta, Instruction}, + loader_instruction, + message::Message, + pubkey::Pubkey, + signature::{Keypair, KeypairUtil}, + system_instruction, +}; pub fn load_program( bank_client: &T, diff --git a/runtime/src/message_processor.rs b/runtime/src/message_processor.rs index 6426efc9b6..9105b0f906 100644 --- a/runtime/src/message_processor.rs +++ b/runtime/src/message_processor.rs @@ -1,18 +1,17 @@ use crate::native_loader; use crate::system_instruction_processor; use serde::{Deserialize, Serialize}; -use solana_sdk::account::{create_keyed_readonly_accounts, Account, KeyedAccount}; -use solana_sdk::clock::Epoch; -use solana_sdk::instruction::{CompiledInstruction, InstructionError}; -use solana_sdk::instruction_processor_utils; -use solana_sdk::message::Message; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::system_program; -use solana_sdk::transaction::TransactionError; -use std::cell::RefCell; -use std::collections::HashMap; -use std::rc::Rc; -use std::sync::RwLock; +use solana_sdk::{ + account::{create_keyed_readonly_accounts, Account, KeyedAccount}, + clock::Epoch, + instruction::{CompiledInstruction, InstructionError}, + instruction_processor_utils, + message::Message, + pubkey::Pubkey, + system_program, + transaction::TransactionError, +}; +use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::RwLock}; #[cfg(unix)] use libloading::os::unix::*; @@ -342,9 +341,11 @@ pub fn is_zeroed(buf: &[u8]) -> bool { #[cfg(test)] mod tests { use super::*; - use solana_sdk::instruction::{AccountMeta, Instruction, InstructionError}; - use solana_sdk::message::Message; - use solana_sdk::native_loader::create_loadable_account; + use solana_sdk::{ + instruction::{AccountMeta, Instruction, InstructionError}, + message::Message, + native_loader::create_loadable_account, + }; #[test] fn test_is_zeroed() { diff --git a/runtime/src/native_loader.rs b/runtime/src/native_loader.rs index 75dcbcef19..e0f7450ac5 100644 --- a/runtime/src/native_loader.rs +++ b/runtime/src/native_loader.rs @@ -5,13 +5,11 @@ use libloading::os::unix::*; #[cfg(windows)] use libloading::os::windows::*; use log::*; -use solana_sdk::account::KeyedAccount; -use solana_sdk::instruction::InstructionError; -use solana_sdk::instruction_processor_utils; -use solana_sdk::pubkey::Pubkey; -use std::env; -use std::path::PathBuf; -use std::str; +use solana_sdk::{ + account::KeyedAccount, instruction::InstructionError, instruction_processor_utils, + pubkey::Pubkey, +}; +use std::{env, path::PathBuf, str}; /// Dynamic link library prefixes #[cfg(unix)] diff --git a/runtime/src/serde_utils.rs b/runtime/src/serde_utils.rs index 24064156b5..527c590e42 100644 --- a/runtime/src/serde_utils.rs +++ b/runtime/src/serde_utils.rs @@ -1,5 +1,7 @@ -use std::fmt; -use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; +use std::{ + fmt, + sync::atomic::{AtomicBool, AtomicU64, Ordering}, +}; struct U64Visitor; impl<'a> serde::de::Visitor<'a> for U64Visitor { diff --git a/runtime/src/stakes.rs b/runtime/src/stakes.rs index 6f33c7f31b..4b31123d5d 100644 --- a/runtime/src/stakes.rs +++ b/runtime/src/stakes.rs @@ -1,9 +1,8 @@ //! Stakes serve as a cache of stake and vote accounts to derive //! node stakes -use solana_sdk::account::Account; -use solana_sdk::clock::Epoch; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::sysvar::stake_history::StakeHistory; +use solana_sdk::{ + account::Account, clock::Epoch, pubkey::Pubkey, sysvar::stake_history::StakeHistory, +}; use solana_stake_program::stake_state::{new_stake_history_entry, Delegation, StakeState}; use solana_vote_program::vote_state::VoteState; use std::collections::HashMap; diff --git a/runtime/src/status_cache.rs b/runtime/src/status_cache.rs index 43b2090b87..f3fad365e2 100644 --- a/runtime/src/status_cache.rs +++ b/runtime/src/status_cache.rs @@ -1,11 +1,15 @@ use log::*; use rand::{thread_rng, Rng}; use serde::Serialize; -use solana_sdk::clock::{Slot, MAX_RECENT_BLOCKHASHES}; -use solana_sdk::hash::Hash; -use solana_sdk::signature::Signature; -use std::collections::{HashMap, HashSet}; -use std::sync::{Arc, Mutex}; +use solana_sdk::{ + clock::{Slot, MAX_RECENT_BLOCKHASHES}, + hash::Hash, + signature::Signature, +}; +use std::{ + collections::{HashMap, HashSet}, + sync::{Arc, Mutex}, +}; pub const MAX_CACHE_ENTRIES: usize = MAX_RECENT_BLOCKHASHES; const CACHED_SIGNATURE_SIZE: usize = 20; diff --git a/runtime/src/storage_utils.rs b/runtime/src/storage_utils.rs index 2cacf7257f..5220856194 100644 --- a/runtime/src/storage_utils.rs +++ b/runtime/src/storage_utils.rs @@ -1,7 +1,5 @@ use crate::bank::Bank; -use solana_sdk::account::Account; -use solana_sdk::account_utils::StateMut; -use solana_sdk::pubkey::Pubkey; +use solana_sdk::{account::Account, account_utils::StateMut, pubkey::Pubkey}; use solana_storage_program::storage_contract::StorageContract; use std::collections::{HashMap, HashSet}; @@ -82,10 +80,12 @@ pub fn archiver_accounts(bank: &Bank) -> HashMap { pub(crate) mod tests { use super::*; use crate::bank_client::BankClient; - use solana_sdk::client::SyncClient; - use solana_sdk::genesis_config::create_genesis_config; - use solana_sdk::message::Message; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::{ + client::SyncClient, + genesis_config::create_genesis_config, + message::Message, + signature::{Keypair, KeypairUtil}, + }; use solana_storage_program::{ storage_contract::{StorageAccount, STORAGE_ACCOUNT_SPACE}, storage_instruction::{self, StorageAccountType}, diff --git a/runtime/src/system_instruction_processor.rs b/runtime/src/system_instruction_processor.rs index d994359976..edfe92a703 100644 --- a/runtime/src/system_instruction_processor.rs +++ b/runtime/src/system_instruction_processor.rs @@ -1,5 +1,4 @@ use log::*; - use solana_sdk::{ account::{get_signers, Account, KeyedAccount}, account_utils::StateMut, @@ -13,7 +12,6 @@ use solana_sdk::{ system_program, sysvar::{self, recent_blockhashes::RecentBlockhashes, rent::Rent, Sysvar}, }; - use std::collections::HashSet; // represents an address that may or may not have been generated diff --git a/runtime/src/transaction_batch.rs b/runtime/src/transaction_batch.rs index 7a493927a5..365bc83eb8 100644 --- a/runtime/src/transaction_batch.rs +++ b/runtime/src/transaction_batch.rs @@ -57,9 +57,11 @@ impl<'a, 'b> Drop for TransactionBatch<'a, 'b> { mod tests { use super::*; use crate::genesis_utils::{create_genesis_config_with_leader, GenesisConfigInfo}; - use solana_sdk::pubkey::Pubkey; - use solana_sdk::signature::{Keypair, KeypairUtil}; - use solana_sdk::system_transaction; + use solana_sdk::{ + pubkey::Pubkey, + signature::{Keypair, KeypairUtil}, + system_transaction, + }; #[test] fn test_transaction_batch() { diff --git a/runtime/tests/bank.rs b/runtime/tests/bank.rs index c743c6b660..cb2d2fdfe0 100644 --- a/runtime/tests/bank.rs +++ b/runtime/tests/bank.rs @@ -1,9 +1,6 @@ use solana_runtime::bank::Bank; -use solana_sdk::genesis_config::create_genesis_config; -use solana_sdk::hash::hash; -use solana_sdk::pubkey::Pubkey; -use std::sync::Arc; -use std::thread::Builder; +use solana_sdk::{genesis_config::create_genesis_config, hash::hash, pubkey::Pubkey}; +use std::{sync::Arc, thread::Builder}; #[test] fn test_race_register_tick_freeze() { diff --git a/runtime/tests/noop.rs b/runtime/tests/noop.rs index 4d8e8f6bbb..49fdda0df3 100644 --- a/runtime/tests/noop.rs +++ b/runtime/tests/noop.rs @@ -1,10 +1,10 @@ -use solana_runtime::bank::Bank; -use solana_runtime::bank_client::BankClient; -use solana_runtime::loader_utils::create_invoke_instruction; -use solana_sdk::client::SyncClient; -use solana_sdk::genesis_config::create_genesis_config; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::KeypairUtil; +use solana_runtime::{ + bank::Bank, bank_client::BankClient, loader_utils::create_invoke_instruction, +}; +use solana_sdk::{ + client::SyncClient, genesis_config::create_genesis_config, pubkey::Pubkey, + signature::KeypairUtil, +}; #[test] fn test_program_native_noop() { diff --git a/runtime/tests/storage.rs b/runtime/tests/storage.rs index 8b80a60986..3e36dba2f3 100644 --- a/runtime/tests/storage.rs +++ b/runtime/tests/storage.rs @@ -26,8 +26,7 @@ use solana_storage_program::{ storage_instruction::{self, StorageAccountType}, storage_processor::process_instruction, }; -use std::collections::HashMap; -use std::sync::Arc; +use std::{collections::HashMap, sync::Arc}; const TICKS_IN_SEGMENT: u64 = DEFAULT_SLOTS_PER_SEGMENT * DEFAULT_TICKS_PER_SLOT;