Remove unused pubkey::Pubkey imports

This commit is contained in:
Michael Vines
2020-10-19 12:23:14 -07:00
parent 17c391121a
commit 959880db60
53 changed files with 243 additions and 115 deletions

View File

@@ -4830,7 +4830,9 @@ pub mod tests {
let accounts = AccountsDB::new_single();
let pubkey_count = 100;
let pubkeys: Vec<_> = (0..pubkey_count).map(|_| solana_sdk::pubkey::new_rand()).collect();
let pubkeys: Vec<_> = (0..pubkey_count)
.map(|_| solana_sdk::pubkey::new_rand())
.collect();
let some_lamport = 223;
let no_data = 0;
@@ -4894,7 +4896,9 @@ pub mod tests {
let accounts = AccountsDB::new_single();
let pubkey_count = 100;
let pubkeys: Vec<_> = (0..pubkey_count).map(|_| solana_sdk::pubkey::new_rand()).collect();
let pubkeys: Vec<_> = (0..pubkey_count)
.map(|_| solana_sdk::pubkey::new_rand())
.collect();
let some_lamport = 223;
let no_data = 0;
@@ -5076,7 +5080,11 @@ pub mod tests {
);
// any random program data accounts
assert_eq!(
AccountsDB::account_balance_for_capitalization(10, &solana_sdk::pubkey::new_rand(), false),
AccountsDB::account_balance_for_capitalization(
10,
&solana_sdk::pubkey::new_rand(),
false
),
10
);
}

View File

@@ -610,7 +610,7 @@ mod tests {
let root_slot = 0;
let mut pubkeys: Vec<Pubkey> = std::iter::repeat_with(|| {
let new_pubkey = Pubkey::new_rand();
let new_pubkey = solana_sdk::pubkey::new_rand();
index.upsert(root_slot, &new_pubkey, true, &mut vec![]);
new_pubkey
})
@@ -742,7 +742,7 @@ mod tests {
let mut iter = index.iter(None::<Range<Pubkey>>);
assert!(iter.next().is_none());
let mut gc = vec![];
index.upsert(0, &Pubkey::new_rand(), true, &mut gc);
index.upsert(0, &solana_sdk::pubkey::new_rand(), true, &mut gc);
assert!(iter.next().is_none());
}

View File

@@ -4275,7 +4275,12 @@ mod tests {
fn test_bank_capitalization() {
let bank = Arc::new(Bank::new(&GenesisConfig {
accounts: (0..42)
.map(|_| (solana_sdk::pubkey::new_rand(), Account::new(42, 0, &Pubkey::default())))
.map(|_| {
(
solana_sdk::pubkey::new_rand(),
Account::new(42, 0, &Pubkey::default()),
)
})
.collect(),
cluster_type: ClusterType::MainnetBeta,
..GenesisConfig::default()
@@ -4852,7 +4857,11 @@ mod tests {
};
let root_bank = Arc::new(Bank::new(&genesis_config));
let bank = create_child_bank_for_rent_test(&root_bank, &genesis_config, solana_sdk::pubkey::new_rand());
let bank = create_child_bank_for_rent_test(
&root_bank,
&genesis_config,
solana_sdk::pubkey::new_rand(),
);
let account_pubkey = solana_sdk::pubkey::new_rand();
let account_balance = 1;
@@ -5941,7 +5950,8 @@ mod tests {
assert!(bank.rewards.read().unwrap().is_empty());
let vote_id = solana_sdk::pubkey::new_rand();
let mut vote_account = vote_state::create_account(&vote_id, &solana_sdk::pubkey::new_rand(), 50, 100);
let mut vote_account =
vote_state::create_account(&vote_id, &solana_sdk::pubkey::new_rand(), 50, 100);
let (stake_id1, stake_account1) = crate::stakes::tests::create_stake_account(123, &vote_id);
let (stake_id2, stake_account2) = crate::stakes::tests::create_stake_account(456, &vote_id);
@@ -7391,7 +7401,11 @@ mod tests {
let bank0 = Arc::new(Bank::new(&genesis_config));
// Bank 1
let bank1 = Arc::new(Bank::new_from_parent(&bank0, &solana_sdk::pubkey::new_rand(), 1));
let bank1 = Arc::new(Bank::new_from_parent(
&bank0,
&solana_sdk::pubkey::new_rand(),
1,
));
// Bank 2
let bank2 = Bank::new_from_parent(&bank0, &solana_sdk::pubkey::new_rand(), 2);
@@ -8306,7 +8320,11 @@ mod tests {
let nonce_tx = Transaction::new_signed_with_payer(
&[
system_instruction::advance_nonce_account(&nonce_pubkey, &nonce_pubkey),
system_instruction::transfer(&custodian_pubkey, &solana_sdk::pubkey::new_rand(), 100_000),
system_instruction::transfer(
&custodian_pubkey,
&solana_sdk::pubkey::new_rand(),
100_000,
),
],
Some(&custodian_pubkey),
&[&custodian_keypair, &nonce_keypair],

View File

@@ -318,9 +318,10 @@ mod test {
assert!(bloom.contains(hash_value));
}
// Round trip, inserting new hash values.
let more_hash_values: Vec<_> = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng))
.take(1000)
.collect();
let more_hash_values: Vec<_> =
std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng))
.take(1000)
.collect();
let bloom: AtomicBloom<_> = bloom.into();
assert_eq!(bloom.num_bits, 9731);
assert_eq!(bloom.bits.len(), (9731 + 63) / 64);

View File

@@ -867,7 +867,10 @@ mod tests {
#[test]
fn test_verify_account_references() {
let accounts = vec![(solana_sdk::pubkey::new_rand(), RefCell::new(Account::default()))];
let accounts = vec![(
solana_sdk::pubkey::new_rand(),
RefCell::new(Account::default()),
)];
assert!(MessageProcessor::verify_account_references(&accounts).is_ok());

View File

@@ -148,7 +148,7 @@ mod tests {
// collect rent on a already-existing account
let collected = rent_collector.collect_from_existing_account(
&solana_sdk::pubkey::new_rand()
&solana_sdk::pubkey::new_rand(),
&mut existing_account,
true,
);

View File

@@ -191,7 +191,8 @@ pub mod tests {
// set up some dummies for a staked node (( vote ) ( stake ))
pub fn create_staked_node_accounts(stake: u64) -> ((Pubkey, Account), (Pubkey, Account)) {
let vote_pubkey = solana_sdk::pubkey::new_rand();
let vote_account = vote_state::create_account(&vote_pubkey, &solana_sdk::pubkey::new_rand(), 0, 1);
let vote_account =
vote_state::create_account(&vote_pubkey, &solana_sdk::pubkey::new_rand(), 0, 1);
(
(vote_pubkey, vote_account),
create_stake_account(stake, &vote_pubkey),
@@ -218,7 +219,8 @@ pub mod tests {
epoch: Epoch,
) -> ((Pubkey, Account), (Pubkey, Account)) {
let vote_pubkey = solana_sdk::pubkey::new_rand();
let vote_account = vote_state::create_account(&vote_pubkey, &solana_sdk::pubkey::new_rand(), 0, 1);
let vote_account =
vote_state::create_account(&vote_pubkey, &solana_sdk::pubkey::new_rand(), 0, 1);
(
(vote_pubkey, vote_account),
create_warming_stake_account(stake, epoch, &vote_pubkey),

View File

@@ -62,7 +62,7 @@ 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, signature::Keypair, system_transaction};
use solana_sdk::{signature::Keypair, system_transaction};
#[test]
fn test_transaction_batch() {