Remove unused pubkey::Pubkey imports
This commit is contained in:
@ -4,13 +4,13 @@ extern crate test;
|
||||
|
||||
use rand::{thread_rng, Rng};
|
||||
use solana_runtime::{accounts_db::AccountInfo, accounts_index::AccountsIndex};
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::pubkey;
|
||||
use test::Bencher;
|
||||
|
||||
#[bench]
|
||||
fn bench_accounts_index(bencher: &mut Bencher) {
|
||||
const NUM_PUBKEYS: usize = 10_000;
|
||||
let pubkeys: Vec<_> = (0..NUM_PUBKEYS).map(|_| solana_sdk::pubkey::new_rand()).collect();
|
||||
let pubkeys: Vec<_> = (0..NUM_PUBKEYS).map(|_| pubkey::new_rand()).collect();
|
||||
|
||||
const NUM_FORKS: u64 = 16;
|
||||
|
||||
|
@ -4,17 +4,17 @@ extern crate test;
|
||||
|
||||
use log::*;
|
||||
use solana_runtime::message_processor::PreAccount;
|
||||
use solana_sdk::{account::Account, pubkey::Pubkey, rent::Rent};
|
||||
use solana_sdk::{account::Account, pubkey, rent::Rent};
|
||||
use test::Bencher;
|
||||
|
||||
#[bench]
|
||||
fn bench_verify_account_changes_data(bencher: &mut Bencher) {
|
||||
solana_logger::setup();
|
||||
|
||||
let owner = solana_sdk::pubkey::new_rand();
|
||||
let non_owner = solana_sdk::pubkey::new_rand();
|
||||
let owner = pubkey::new_rand();
|
||||
let non_owner = pubkey::new_rand();
|
||||
let pre = PreAccount::new(
|
||||
&solana_sdk::pubkey::new_rand(),
|
||||
&pubkey::new_rand(),
|
||||
&Account::new(0, BUFSIZE, &owner),
|
||||
true,
|
||||
false,
|
||||
@ -36,7 +36,7 @@ fn bench_verify_account_changes_data(bencher: &mut Bencher) {
|
||||
info!("data compare {} ns/iter", summary.median);
|
||||
|
||||
let pre = PreAccount::new(
|
||||
&solana_sdk::pubkey::new_rand(),
|
||||
&pubkey::new_rand(),
|
||||
&Account::new(0, BUFSIZE, &owner),
|
||||
true,
|
||||
false,
|
||||
|
@ -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
|
||||
);
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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],
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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,
|
||||
);
|
||||
|
@ -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),
|
||||
|
@ -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() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
use solana_runtime::bank::Bank;
|
||||
use solana_sdk::{genesis_config::create_genesis_config, hash::hash, pubkey::Pubkey};
|
||||
use solana_sdk::{genesis_config::create_genesis_config, hash::hash};
|
||||
use std::{sync::Arc, thread::Builder};
|
||||
|
||||
#[test]
|
||||
|
@ -1,9 +1,7 @@
|
||||
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::Signer,
|
||||
};
|
||||
use solana_sdk::{client::SyncClient, genesis_config::create_genesis_config, signature::Signer};
|
||||
|
||||
#[test]
|
||||
fn test_program_native_noop() {
|
||||
|
@ -105,7 +105,11 @@ fn test_stake_create_and_split_single_signature() {
|
||||
genesis_config,
|
||||
mint_keypair: staker_keypair,
|
||||
..
|
||||
} = create_genesis_config_with_leader(100_000_000_000, &solana_sdk::pubkey::new_rand(), 1_000_000);
|
||||
} = create_genesis_config_with_leader(
|
||||
100_000_000_000,
|
||||
&solana_sdk::pubkey::new_rand(),
|
||||
1_000_000,
|
||||
);
|
||||
|
||||
let staker_pubkey = staker_keypair.pubkey();
|
||||
|
||||
@ -172,7 +176,11 @@ fn test_stake_create_and_split_to_existing_system_account() {
|
||||
genesis_config,
|
||||
mint_keypair: staker_keypair,
|
||||
..
|
||||
} = create_genesis_config_with_leader(100_000_000_000, &solana_sdk::pubkey::new_rand(), 1_000_000);
|
||||
} = create_genesis_config_with_leader(
|
||||
100_000_000_000,
|
||||
&solana_sdk::pubkey::new_rand(),
|
||||
1_000_000,
|
||||
);
|
||||
|
||||
let staker_pubkey = staker_keypair.pubkey();
|
||||
|
||||
@ -255,7 +263,11 @@ fn test_stake_account_lifetime() {
|
||||
genesis_config,
|
||||
mint_keypair,
|
||||
..
|
||||
} = create_genesis_config_with_leader(100_000_000_000, &solana_sdk::pubkey::new_rand(), 1_000_000);
|
||||
} = create_genesis_config_with_leader(
|
||||
100_000_000_000,
|
||||
&solana_sdk::pubkey::new_rand(),
|
||||
1_000_000,
|
||||
);
|
||||
let bank = Bank::new(&genesis_config);
|
||||
let mint_pubkey = mint_keypair.pubkey();
|
||||
let mut bank = Arc::new(bank);
|
||||
@ -495,7 +507,11 @@ fn test_create_stake_account_from_seed() {
|
||||
genesis_config,
|
||||
mint_keypair,
|
||||
..
|
||||
} = create_genesis_config_with_leader(100_000_000_000, &solana_sdk::pubkey::new_rand(), 1_000_000);
|
||||
} = create_genesis_config_with_leader(
|
||||
100_000_000_000,
|
||||
&solana_sdk::pubkey::new_rand(),
|
||||
1_000_000,
|
||||
);
|
||||
let bank = Bank::new(&genesis_config);
|
||||
let mint_pubkey = mint_keypair.pubkey();
|
||||
let bank = Arc::new(bank);
|
||||
|
Reference in New Issue
Block a user