Cleanup runtime use syntax (#8002)

This commit is contained in:
Jack May
2020-01-28 17:03:20 -08:00
committed by GitHub
parent 4a074133f7
commit 83718a3b3e
26 changed files with 201 additions and 184 deletions

View File

@ -2,11 +2,11 @@
extern crate test; extern crate test;
use solana_runtime::accounts::{create_test_accounts, Accounts}; use solana_runtime::{
use solana_runtime::bank::*; accounts::{create_test_accounts, Accounts},
use solana_sdk::account::Account; bank::*,
use solana_sdk::genesis_config::create_genesis_config; };
use solana_sdk::pubkey::Pubkey; use solana_sdk::{account::Account, genesis_config::create_genesis_config, pubkey::Pubkey};
use std::{path::PathBuf, sync::Arc}; use std::{path::PathBuf, sync::Arc};
use test::Bencher; use test::Bencher;

View File

@ -3,8 +3,7 @@
extern crate test; extern crate test;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use solana_runtime::accounts_db::AccountInfo; use solana_runtime::{accounts_db::AccountInfo, accounts_index::AccountsIndex};
use solana_runtime::accounts_index::AccountsIndex;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use test::Bencher; use test::Bencher;

View File

@ -2,13 +2,17 @@
extern crate test; extern crate test;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use solana_runtime::append_vec::test_utils::{create_test_account, get_append_vec_path}; use solana_runtime::append_vec::{
use solana_runtime::append_vec::AppendVec; test_utils::{create_test_account, get_append_vec_path},
AppendVec,
};
use solana_sdk::hash::Hash; use solana_sdk::hash::Hash;
use std::sync::{Arc, Mutex}; use std::{
use std::thread::sleep; sync::{Arc, Mutex},
use std::thread::spawn; thread::sleep,
use std::time::Duration; thread::spawn,
time::Duration,
};
use test::Bencher; use test::Bencher;
#[bench] #[bench]

View File

@ -3,21 +3,19 @@
extern crate test; extern crate test;
use log::*; use log::*;
use solana_runtime::bank::*; use solana_runtime::{bank::*, bank_client::BankClient, loader_utils::create_invoke_instruction};
use solana_runtime::bank_client::BankClient; use solana_sdk::{
use solana_runtime::loader_utils::create_invoke_instruction; account::KeyedAccount,
use solana_sdk::account::KeyedAccount; client::AsyncClient,
use solana_sdk::client::AsyncClient; client::SyncClient,
use solana_sdk::client::SyncClient; clock::MAX_RECENT_BLOCKHASHES,
use solana_sdk::clock::MAX_RECENT_BLOCKHASHES; genesis_config::create_genesis_config,
use solana_sdk::genesis_config::create_genesis_config; instruction::InstructionError,
use solana_sdk::instruction::InstructionError; pubkey::Pubkey,
use solana_sdk::pubkey::Pubkey; signature::{Keypair, KeypairUtil},
use solana_sdk::signature::{Keypair, KeypairUtil}; transaction::Transaction,
use solana_sdk::transaction::Transaction; };
use std::sync::Arc; use std::{sync::Arc, thread::sleep, time::Duration};
use std::thread::sleep;
use std::time::Duration;
use test::Bencher; use test::Bencher;
const BUILTIN_PROGRAM_ID: [u8; 32] = [ const BUILTIN_PROGRAM_ID: [u8; 32] = [

View File

@ -4,8 +4,10 @@ extern crate test;
use bv::BitVec; use bv::BitVec;
use fnv::FnvHasher; use fnv::FnvHasher;
use solana_runtime::bloom::{Bloom, BloomHashIndex}; use solana_runtime::bloom::{Bloom, BloomHashIndex};
use solana_sdk::hash::{hash, Hash}; use solana_sdk::{
use solana_sdk::signature::Signature; hash::{hash, Hash},
signature::Signature,
};
use std::collections::HashSet; use std::collections::HashSet;
use std::hash::Hasher; use std::hash::Hasher;
use test::Bencher; use test::Bencher;

View File

@ -4,8 +4,10 @@ extern crate test;
use bincode::serialize; use bincode::serialize;
use solana_runtime::status_cache::*; use solana_runtime::status_cache::*;
use solana_sdk::hash::{hash, Hash}; use solana_sdk::{
use solana_sdk::signature::Signature; hash::{hash, Hash},
signature::Signature,
};
use test::Bencher; use test::Bencher;
type BankStatusCache = StatusCache<()>; type BankStatusCache = StatusCache<()>;

View File

@ -2,8 +2,7 @@
extern crate test; extern crate test;
use rand::seq::SliceRandom; use rand::{seq::SliceRandom, thread_rng};
use rand::thread_rng;
use solana_runtime::transaction_utils::OrderedIterator; use solana_runtime::transaction_utils::OrderedIterator;
use test::Bencher; use test::Bencher;

View File

@ -1,30 +1,35 @@
use crate::accounts_db::{ use crate::{
AccountInfo, AccountStorage, AccountsDB, AppendVecId, BankHashInfo, ErrorCounters, 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 log::*;
use rayon::slice::ParallelSliceMut; use rayon::slice::ParallelSliceMut;
use solana_sdk::account::Account; use solana_sdk::{
use solana_sdk::bank_hash::BankHash; account::Account,
use solana_sdk::clock::Slot; bank_hash::BankHash,
use solana_sdk::hash::Hash; clock::Slot,
use solana_sdk::native_loader; hash::Hash,
use solana_sdk::nonce_state::NonceState; native_loader,
use solana_sdk::pubkey::Pubkey; nonce_state::NonceState,
use solana_sdk::transaction::Result; pubkey::Pubkey,
use solana_sdk::transaction::{Transaction, TransactionError}; transaction::Result,
use std::collections::{HashMap, HashSet}; transaction::{Transaction, TransactionError},
use std::io::{BufReader, Error as IOError, Read}; };
use std::path::{Path, PathBuf}; use std::{
use std::sync::{Arc, Mutex, RwLock}; collections::{HashMap, HashSet},
io::{BufReader, Error as IOError, Read},
use crate::transaction_utils::OrderedIterator; path::{Path, PathBuf},
sync::{Arc, Mutex, RwLock},
};
#[derive(Default, Debug)] #[derive(Default, Debug)]
struct ReadonlyLock { struct ReadonlyLock {
@ -648,26 +653,34 @@ mod tests {
// TODO: all the bank tests are bank specific, issue: 2194 // TODO: all the bank tests are bank specific, issue: 2194
use super::*; use super::*;
use crate::accounts_db::tests::copy_append_vecs; use crate::{
use crate::accounts_db::{get_temp_accounts_paths, AccountsDBSerialize}; accounts_db::{
use crate::bank::HashAgeKind; tests::copy_append_vecs,
use crate::rent_collector::RentCollector; {get_temp_accounts_paths, AccountsDBSerialize},
},
bank::HashAgeKind,
rent_collector::RentCollector,
};
use bincode::serialize_into; use bincode::serialize_into;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use solana_sdk::account::Account; use solana_sdk::{
use solana_sdk::epoch_schedule::EpochSchedule; account::Account,
use solana_sdk::fee_calculator::FeeCalculator; epoch_schedule::EpochSchedule,
use solana_sdk::hash::Hash; fee_calculator::FeeCalculator,
use solana_sdk::instruction::CompiledInstruction; hash::Hash,
use solana_sdk::message::Message; instruction::CompiledInstruction,
use solana_sdk::nonce_state; message::Message,
use solana_sdk::rent::Rent; nonce_state,
use solana_sdk::signature::{Keypair, KeypairUtil}; rent::Rent,
use solana_sdk::system_program; signature::{Keypair, KeypairUtil},
use solana_sdk::transaction::Transaction; system_program,
use std::io::Cursor; transaction::Transaction,
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; };
use std::{thread, time}; use std::{
io::Cursor,
sync::atomic::{AtomicBool, AtomicU64, Ordering},
{thread, time},
};
use tempfile::TempDir; use tempfile::TempDir;
fn load_accounts_with_fee_and_rent( fn load_accounts_with_fee_and_rent(

View File

@ -18,33 +18,39 @@
//! tracks the number of commits to the entire data store. So the latest //! tracks the number of commits to the entire data store. So the latest
//! commit for each slot entry would be indexed. //! commit for each slot entry would be indexed.
use crate::accounts_index::AccountsIndex; use crate::{
use crate::append_vec::{AppendVec, StoredAccount, StoredMeta}; accounts_index::AccountsIndex,
use crate::bank::deserialize_from_snapshot; append_vec::{AppendVec, StoredAccount, StoredMeta},
bank::deserialize_from_snapshot,
};
use bincode::{deserialize_from, serialize_into}; use bincode::{deserialize_from, serialize_into};
use byteorder::{ByteOrder, LittleEndian}; use byteorder::{ByteOrder, LittleEndian};
use fs_extra::dir::CopyOptions; use fs_extra::dir::CopyOptions;
use log::*; use log::*;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use rayon::prelude::*; use rayon::{prelude::*, ThreadPool};
use rayon::ThreadPool; use serde::{
use serde::de::{MapAccess, Visitor}; de::{MapAccess, Visitor},
use serde::ser::{SerializeMap, Serializer}; ser::{SerializeMap, Serializer},
use serde::{Deserialize, Serialize}; Deserialize, Serialize,
};
use solana_measure::measure::Measure; use solana_measure::measure::Measure;
use solana_rayon_threadlimit::get_thread_count; use solana_rayon_threadlimit::get_thread_count;
use solana_sdk::account::Account; use solana_sdk::{
use solana_sdk::bank_hash::BankHash; account::Account,
use solana_sdk::clock::{Epoch, Slot}; bank_hash::BankHash,
use solana_sdk::hash::{Hash, Hasher}; clock::{Epoch, Slot},
use solana_sdk::pubkey::Pubkey; hash::{Hash, Hasher},
use std::collections::{HashMap, HashSet}; pubkey::Pubkey,
use std::fmt; };
use std::io::{BufReader, Cursor, Error as IOError, ErrorKind, Read, Result as IOResult}; use std::{
use std::path::Path; collections::{HashMap, HashSet},
use std::path::PathBuf; fmt,
use std::sync::atomic::{AtomicUsize, Ordering}; io::{BufReader, Cursor, Error as IOError, ErrorKind, Read, Result as IOResult},
use std::sync::{Arc, RwLock}; path::{Path, PathBuf},
sync::atomic::{AtomicUsize, Ordering},
sync::{Arc, RwLock},
};
use tempfile::TempDir; use tempfile::TempDir;
pub const DEFAULT_FILE_SIZE: u64 = 4 * 1024 * 1024; pub const DEFAULT_FILE_SIZE: u64 = 4 * 1024 * 1024;
@ -1320,10 +1326,8 @@ pub mod tests {
use assert_matches::assert_matches; use assert_matches::assert_matches;
use bincode::serialize_into; use bincode::serialize_into;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use solana_sdk::account::Account; use solana_sdk::{account::Account, hash::HASH_BYTES};
use solana_sdk::hash::HASH_BYTES; use std::{fs, str::FromStr};
use std::fs;
use std::str::FromStr;
use tempfile::TempDir; use tempfile::TempDir;
#[test] #[test]

View File

@ -1,6 +1,8 @@
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use std::collections::{HashMap, HashSet}; use std::{
use std::sync::{RwLock, RwLockReadGuard}; collections::{HashMap, HashSet},
sync::{RwLock, RwLockReadGuard},
};
pub type Slot = u64; pub type Slot = u64;
type SlotList<T> = Vec<(Slot, T)>; type SlotList<T> = Vec<(Slot, T)>;

View File

@ -2188,29 +2188,27 @@ impl From<LegacyBank0223> for Bank {
mod tests { mod tests {
use super::*; use super::*;
use crate::{ use crate::{
accounts_db::get_temp_accounts_paths, accounts_db::{get_temp_accounts_paths, tests::copy_append_vecs},
accounts_db::tests::copy_append_vecs,
genesis_utils::{ genesis_utils::{
create_genesis_config_with_leader, GenesisConfigInfo, BOOTSTRAP_VALIDATOR_LAMPORTS, create_genesis_config_with_leader, GenesisConfigInfo, BOOTSTRAP_VALIDATOR_LAMPORTS,
}, },
status_cache::MAX_CACHE_ENTRIES, status_cache::MAX_CACHE_ENTRIES,
}; };
use bincode::{serialize_into, serialized_size}; use bincode::{serialize_into, serialized_size};
use solana_sdk::instruction::AccountMeta;
use solana_sdk::system_program::solana_system_program;
use solana_sdk::{ use solana_sdk::{
account::KeyedAccount, account::KeyedAccount,
account_utils::StateMut, account_utils::StateMut,
clock::DEFAULT_TICKS_PER_SLOT, clock::DEFAULT_TICKS_PER_SLOT,
epoch_schedule::MINIMUM_SLOTS_PER_EPOCH, epoch_schedule::MINIMUM_SLOTS_PER_EPOCH,
genesis_config::create_genesis_config, genesis_config::create_genesis_config,
instruction::{CompiledInstruction, Instruction, InstructionError}, instruction::{AccountMeta, CompiledInstruction, Instruction, InstructionError},
message::{Message, MessageHeader}, message::{Message, MessageHeader},
nonce_state, nonce_state,
poh_config::PohConfig, poh_config::PohConfig,
rent::Rent, rent::Rent,
signature::{Keypair, KeypairUtil}, signature::{Keypair, KeypairUtil},
system_instruction, system_program, system_instruction,
system_program::{self, solana_system_program},
sysvar::{fees::Fees, rewards::Rewards}, sysvar::{fees::Fees, rewards::Rewards},
timing::duration_as_s, timing::duration_as_s,
}; };

View File

@ -274,8 +274,7 @@ impl BankClient {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use solana_sdk::genesis_config::create_genesis_config; use solana_sdk::{genesis_config::create_genesis_config, instruction::AccountMeta};
use solana_sdk::instruction::AccountMeta;
#[test] #[test]
fn test_bank_client_new_with_keypairs() { fn test_bank_client_new_with_keypairs() {

View File

@ -1,7 +1,5 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use solana_sdk::fee_calculator::FeeCalculator; use solana_sdk::{fee_calculator::FeeCalculator, hash::Hash, timing::timestamp};
use solana_sdk::hash::Hash;
use solana_sdk::timing::timestamp;
use std::collections::HashMap; use std::collections::HashMap;
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
@ -122,8 +120,7 @@ impl BlockhashQueue {
mod tests { mod tests {
use super::*; use super::*;
use bincode::serialize; use bincode::serialize;
use solana_sdk::clock::MAX_RECENT_BLOCKHASHES; use solana_sdk::{clock::MAX_RECENT_BLOCKHASHES, hash::hash};
use solana_sdk::hash::hash;
#[test] #[test]
fn test_register_hash() { fn test_register_hash() {

View File

@ -3,9 +3,7 @@ use bv::BitVec;
use fnv::FnvHasher; use fnv::FnvHasher;
use rand::{self, Rng}; use rand::{self, Rng};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::cmp; use std::{cmp, hash::Hasher, marker::PhantomData};
use std::hash::Hasher;
use std::marker::PhantomData;
/// Generate a stable hash of `self` for each `hash_index` /// Generate a stable hash of `self` for each `hash_index`
/// Best effort can be made for uniqueness of each hash. /// Best effort can be made for uniqueness of each hash.

View File

@ -1,11 +1,13 @@
use serde::Serialize; use serde::Serialize;
use solana_sdk::client::Client; use solana_sdk::{
use solana_sdk::instruction::{AccountMeta, Instruction}; client::Client,
use solana_sdk::loader_instruction; instruction::{AccountMeta, Instruction},
use solana_sdk::message::Message; loader_instruction,
use solana_sdk::pubkey::Pubkey; message::Message,
use solana_sdk::signature::{Keypair, KeypairUtil}; pubkey::Pubkey,
use solana_sdk::system_instruction; signature::{Keypair, KeypairUtil},
system_instruction,
};
pub fn load_program<T: Client>( pub fn load_program<T: Client>(
bank_client: &T, bank_client: &T,

View File

@ -1,18 +1,17 @@
use crate::native_loader; use crate::native_loader;
use crate::system_instruction_processor; use crate::system_instruction_processor;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use solana_sdk::account::{create_keyed_readonly_accounts, Account, KeyedAccount}; use solana_sdk::{
use solana_sdk::clock::Epoch; account::{create_keyed_readonly_accounts, Account, KeyedAccount},
use solana_sdk::instruction::{CompiledInstruction, InstructionError}; clock::Epoch,
use solana_sdk::instruction_processor_utils; instruction::{CompiledInstruction, InstructionError},
use solana_sdk::message::Message; instruction_processor_utils,
use solana_sdk::pubkey::Pubkey; message::Message,
use solana_sdk::system_program; pubkey::Pubkey,
use solana_sdk::transaction::TransactionError; system_program,
use std::cell::RefCell; transaction::TransactionError,
use std::collections::HashMap; };
use std::rc::Rc; use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::RwLock};
use std::sync::RwLock;
#[cfg(unix)] #[cfg(unix)]
use libloading::os::unix::*; use libloading::os::unix::*;
@ -342,9 +341,11 @@ pub fn is_zeroed(buf: &[u8]) -> bool {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use solana_sdk::instruction::{AccountMeta, Instruction, InstructionError}; use solana_sdk::{
use solana_sdk::message::Message; instruction::{AccountMeta, Instruction, InstructionError},
use solana_sdk::native_loader::create_loadable_account; message::Message,
native_loader::create_loadable_account,
};
#[test] #[test]
fn test_is_zeroed() { fn test_is_zeroed() {

View File

@ -5,13 +5,11 @@ use libloading::os::unix::*;
#[cfg(windows)] #[cfg(windows)]
use libloading::os::windows::*; use libloading::os::windows::*;
use log::*; use log::*;
use solana_sdk::account::KeyedAccount; use solana_sdk::{
use solana_sdk::instruction::InstructionError; account::KeyedAccount, instruction::InstructionError, instruction_processor_utils,
use solana_sdk::instruction_processor_utils; pubkey::Pubkey,
use solana_sdk::pubkey::Pubkey; };
use std::env; use std::{env, path::PathBuf, str};
use std::path::PathBuf;
use std::str;
/// Dynamic link library prefixes /// Dynamic link library prefixes
#[cfg(unix)] #[cfg(unix)]

View File

@ -1,5 +1,7 @@
use std::fmt; use std::{
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; fmt,
sync::atomic::{AtomicBool, AtomicU64, Ordering},
};
struct U64Visitor; struct U64Visitor;
impl<'a> serde::de::Visitor<'a> for U64Visitor { impl<'a> serde::de::Visitor<'a> for U64Visitor {

View File

@ -1,9 +1,8 @@
//! Stakes serve as a cache of stake and vote accounts to derive //! Stakes serve as a cache of stake and vote accounts to derive
//! node stakes //! node stakes
use solana_sdk::account::Account; use solana_sdk::{
use solana_sdk::clock::Epoch; account::Account, clock::Epoch, pubkey::Pubkey, sysvar::stake_history::StakeHistory,
use solana_sdk::pubkey::Pubkey; };
use solana_sdk::sysvar::stake_history::StakeHistory;
use solana_stake_program::stake_state::{new_stake_history_entry, Delegation, StakeState}; use solana_stake_program::stake_state::{new_stake_history_entry, Delegation, StakeState};
use solana_vote_program::vote_state::VoteState; use solana_vote_program::vote_state::VoteState;
use std::collections::HashMap; use std::collections::HashMap;

View File

@ -1,11 +1,15 @@
use log::*; use log::*;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use serde::Serialize; use serde::Serialize;
use solana_sdk::clock::{Slot, MAX_RECENT_BLOCKHASHES}; use solana_sdk::{
use solana_sdk::hash::Hash; clock::{Slot, MAX_RECENT_BLOCKHASHES},
use solana_sdk::signature::Signature; hash::Hash,
use std::collections::{HashMap, HashSet}; signature::Signature,
use std::sync::{Arc, Mutex}; };
use std::{
collections::{HashMap, HashSet},
sync::{Arc, Mutex},
};
pub const MAX_CACHE_ENTRIES: usize = MAX_RECENT_BLOCKHASHES; pub const MAX_CACHE_ENTRIES: usize = MAX_RECENT_BLOCKHASHES;
const CACHED_SIGNATURE_SIZE: usize = 20; const CACHED_SIGNATURE_SIZE: usize = 20;

View File

@ -1,7 +1,5 @@
use crate::bank::Bank; use crate::bank::Bank;
use solana_sdk::account::Account; use solana_sdk::{account::Account, account_utils::StateMut, pubkey::Pubkey};
use solana_sdk::account_utils::StateMut;
use solana_sdk::pubkey::Pubkey;
use solana_storage_program::storage_contract::StorageContract; use solana_storage_program::storage_contract::StorageContract;
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
@ -82,10 +80,12 @@ pub fn archiver_accounts(bank: &Bank) -> HashMap<Pubkey, Account> {
pub(crate) mod tests { pub(crate) mod tests {
use super::*; use super::*;
use crate::bank_client::BankClient; use crate::bank_client::BankClient;
use solana_sdk::client::SyncClient; use solana_sdk::{
use solana_sdk::genesis_config::create_genesis_config; client::SyncClient,
use solana_sdk::message::Message; genesis_config::create_genesis_config,
use solana_sdk::signature::{Keypair, KeypairUtil}; message::Message,
signature::{Keypair, KeypairUtil},
};
use solana_storage_program::{ use solana_storage_program::{
storage_contract::{StorageAccount, STORAGE_ACCOUNT_SPACE}, storage_contract::{StorageAccount, STORAGE_ACCOUNT_SPACE},
storage_instruction::{self, StorageAccountType}, storage_instruction::{self, StorageAccountType},

View File

@ -1,5 +1,4 @@
use log::*; use log::*;
use solana_sdk::{ use solana_sdk::{
account::{get_signers, Account, KeyedAccount}, account::{get_signers, Account, KeyedAccount},
account_utils::StateMut, account_utils::StateMut,
@ -13,7 +12,6 @@ use solana_sdk::{
system_program, system_program,
sysvar::{self, recent_blockhashes::RecentBlockhashes, rent::Rent, Sysvar}, sysvar::{self, recent_blockhashes::RecentBlockhashes, rent::Rent, Sysvar},
}; };
use std::collections::HashSet; use std::collections::HashSet;
// represents an address that may or may not have been generated // represents an address that may or may not have been generated

View File

@ -57,9 +57,11 @@ impl<'a, 'b> Drop for TransactionBatch<'a, 'b> {
mod tests { mod tests {
use super::*; use super::*;
use crate::genesis_utils::{create_genesis_config_with_leader, GenesisConfigInfo}; use crate::genesis_utils::{create_genesis_config_with_leader, GenesisConfigInfo};
use solana_sdk::pubkey::Pubkey; use solana_sdk::{
use solana_sdk::signature::{Keypair, KeypairUtil}; pubkey::Pubkey,
use solana_sdk::system_transaction; signature::{Keypair, KeypairUtil},
system_transaction,
};
#[test] #[test]
fn test_transaction_batch() { fn test_transaction_batch() {

View File

@ -1,9 +1,6 @@
use solana_runtime::bank::Bank; use solana_runtime::bank::Bank;
use solana_sdk::genesis_config::create_genesis_config; use solana_sdk::{genesis_config::create_genesis_config, hash::hash, pubkey::Pubkey};
use solana_sdk::hash::hash; use std::{sync::Arc, thread::Builder};
use solana_sdk::pubkey::Pubkey;
use std::sync::Arc;
use std::thread::Builder;
#[test] #[test]
fn test_race_register_tick_freeze() { fn test_race_register_tick_freeze() {

View File

@ -1,10 +1,10 @@
use solana_runtime::bank::Bank; use solana_runtime::{
use solana_runtime::bank_client::BankClient; bank::Bank, bank_client::BankClient, loader_utils::create_invoke_instruction,
use solana_runtime::loader_utils::create_invoke_instruction; };
use solana_sdk::client::SyncClient; use solana_sdk::{
use solana_sdk::genesis_config::create_genesis_config; client::SyncClient, genesis_config::create_genesis_config, pubkey::Pubkey,
use solana_sdk::pubkey::Pubkey; signature::KeypairUtil,
use solana_sdk::signature::KeypairUtil; };
#[test] #[test]
fn test_program_native_noop() { fn test_program_native_noop() {

View File

@ -26,8 +26,7 @@ use solana_storage_program::{
storage_instruction::{self, StorageAccountType}, storage_instruction::{self, StorageAccountType},
storage_processor::process_instruction, storage_processor::process_instruction,
}; };
use std::collections::HashMap; use std::{collections::HashMap, sync::Arc};
use std::sync::Arc;
const TICKS_IN_SEGMENT: u64 = DEFAULT_SLOTS_PER_SEGMENT * DEFAULT_TICKS_PER_SLOT; const TICKS_IN_SEGMENT: u64 = DEFAULT_SLOTS_PER_SEGMENT * DEFAULT_TICKS_PER_SLOT;