diff --git a/account-decoder/src/parse_stake.rs b/account-decoder/src/parse_stake.rs index 557a6e54c..86dc88e80 100644 --- a/account-decoder/src/parse_stake.rs +++ b/account-decoder/src/parse_stake.rs @@ -134,7 +134,6 @@ impl From for UiDelegation { mod test { use super::*; use bincode::serialize; - use solana_sdk::pubkey::Pubkey; #[test] fn test_parse_stake() { diff --git a/banking-bench/src/main.rs b/banking-bench/src/main.rs index 4e54b8f37..67b61a8fd 100644 --- a/banking-bench/src/main.rs +++ b/banking-bench/src/main.rs @@ -20,7 +20,6 @@ use solana_perf::packet::to_packets_chunked; use solana_runtime::{bank::Bank, bank_forks::BankForks}; use solana_sdk::{ hash::Hash, - pubkey::Pubkey, signature::Keypair, signature::Signature, system_transaction, diff --git a/banks-client/src/lib.rs b/banks-client/src/lib.rs index 238c38c69..9bb74b37b 100644 --- a/banks-client/src/lib.rs +++ b/banks-client/src/lib.rs @@ -213,7 +213,7 @@ mod tests { use super::*; use solana_banks_server::banks_server::start_local_server; use solana_runtime::{bank::Bank, bank_forks::BankForks, genesis_utils::create_genesis_config}; - use solana_sdk::{message::Message, pubkey::Pubkey, signature::Signer, system_instruction}; + use solana_sdk::{message::Message, signature::Signer, system_instruction}; use std::sync::{Arc, RwLock}; use tarpc::transport; use tokio::{runtime::Runtime, time::delay_for}; diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 7a3e57177..a44c64a4c 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -2409,7 +2409,10 @@ mod tests { .unwrap(); assert_eq!(signer_info.signers.len(), 1); assert_eq!(signer_info.index_of(None), Some(0)); - assert_eq!(signer_info.index_of(Some(solana_sdk::pubkey::new_rand())), None); + assert_eq!( + signer_info.index_of(Some(solana_sdk::pubkey::new_rand())), + None + ); let keypair0 = keypair_from_seed(&[1u8; 32]).unwrap(); let keypair0_pubkey = keypair0.pubkey(); diff --git a/cli/tests/vote.rs b/cli/tests/vote.rs index 0d23a78f2..0bcf66831 100644 --- a/cli/tests/vote.rs +++ b/cli/tests/vote.rs @@ -12,7 +12,6 @@ use solana_faucet::faucet::run_local_faucet; use solana_sdk::{ account_utils::StateMut, commitment_config::CommitmentConfig, - pubkey::Pubkey, signature::{Keypair, Signer}, }; use solana_vote_program::vote_state::{VoteAuthorize, VoteState, VoteStateVersions}; diff --git a/core/benches/banking_stage.rs b/core/benches/banking_stage.rs index 4a81c8619..bfda8d072 100644 --- a/core/benches/banking_stage.rs +++ b/core/benches/banking_stage.rs @@ -20,7 +20,7 @@ use solana_runtime::bank::Bank; use solana_sdk::genesis_config::GenesisConfig; use solana_sdk::hash::Hash; use solana_sdk::message::Message; -use solana_sdk::pubkey::Pubkey; +use solana_sdk::pubkey; use solana_sdk::signature::Keypair; use solana_sdk::signature::Signature; use solana_sdk::signature::Signer; @@ -56,7 +56,7 @@ fn bench_consume_buffered(bencher: &mut Bencher) { let GenesisConfigInfo { genesis_config, .. } = create_genesis_config(100_000); let bank = Arc::new(Bank::new(&genesis_config)); let ledger_path = get_tmp_ledger_path!(); - let my_pubkey = solana_sdk::pubkey::new_rand(); + let my_pubkey = pubkey::new_rand(); { let blockstore = Arc::new( Blockstore::open(&ledger_path).expect("Expected to be able to open database ledger"), @@ -94,15 +94,15 @@ fn bench_consume_buffered(bencher: &mut Bencher) { } fn make_accounts_txs(txes: usize, mint_keypair: &Keypair, hash: Hash) -> Vec { - let to_pubkey = solana_sdk::pubkey::new_rand(); + let to_pubkey = pubkey::new_rand(); let dummy = system_transaction::transfer(mint_keypair, &to_pubkey, 1, hash); (0..txes) .into_par_iter() .map(|_| { let mut new = dummy.clone(); let sig: Vec = (0..64).map(|_| thread_rng().gen()).collect(); - new.message.account_keys[0] = solana_sdk::pubkey::new_rand(); - new.message.account_keys[1] = solana_sdk::pubkey::new_rand(); + new.message.account_keys[0] = pubkey::new_rand(); + new.message.account_keys[1] = pubkey::new_rand(); new.signatures = vec![Signature::new(&sig[0..64])]; new }) @@ -117,7 +117,7 @@ fn make_programs_txs(txes: usize, hash: Hash) -> Vec { let mut instructions = vec![]; let from_key = Keypair::new(); for _ in 1..progs { - let to_key = solana_sdk::pubkey::new_rand(); + let to_key = pubkey::new_rand(); instructions.push(system_instruction::transfer(&from_key.pubkey(), &to_key, 1)); } let message = Message::new(&instructions, Some(&from_key.pubkey())); diff --git a/core/benches/cluster_info.rs b/core/benches/cluster_info.rs index 42a32d2cd..f4aaf54b7 100644 --- a/core/benches/cluster_info.rs +++ b/core/benches/cluster_info.rs @@ -8,7 +8,7 @@ use solana_core::broadcast_stage::{broadcast_shreds, get_broadcast_peers}; use solana_core::cluster_info::{ClusterInfo, Node}; use solana_core::contact_info::ContactInfo; use solana_ledger::shred::Shred; -use solana_sdk::pubkey::Pubkey; +use solana_sdk::pubkey; use solana_sdk::timing::timestamp; use std::{ collections::HashMap, @@ -20,7 +20,7 @@ use test::Bencher; #[bench] fn broadcast_shreds_bench(bencher: &mut Bencher) { solana_logger::setup(); - let leader_pubkey = solana_sdk::pubkey::new_rand(); + let leader_pubkey = pubkey::new_rand(); let leader_info = Node::new_localhost_with_pubkey(&leader_pubkey); let cluster_info = ClusterInfo::new_with_invalid_keypair(leader_info.info); let socket = UdpSocket::bind("0.0.0.0:0").unwrap(); @@ -30,7 +30,7 @@ fn broadcast_shreds_bench(bencher: &mut Bencher) { let mut stakes = HashMap::new(); const NUM_PEERS: usize = 200; for _ in 0..NUM_PEERS { - let id = solana_sdk::pubkey::new_rand(); + let id = pubkey::new_rand(); let contact_info = ContactInfo::new_localhost(&id, timestamp()); cluster_info.insert_info(contact_info); stakes.insert(id, thread_rng().gen_range(1, NUM_PEERS) as u64); diff --git a/core/benches/crds_gossip_pull.rs b/core/benches/crds_gossip_pull.rs index c0b64eaf8..33f85fb3b 100644 --- a/core/benches/crds_gossip_pull.rs +++ b/core/benches/crds_gossip_pull.rs @@ -8,13 +8,13 @@ use solana_core::cluster_info::MAX_BLOOM_SIZE; use solana_core::crds::Crds; use solana_core::crds_gossip_pull::{CrdsFilter, CrdsGossipPull}; use solana_core::crds_value::CrdsValue; -use solana_sdk::hash::Hash; +use solana_sdk::hash; use test::Bencher; #[bench] fn bench_hash_as_u64(bencher: &mut Bencher) { let mut rng = thread_rng(); - let hashes: Vec<_> = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) + let hashes: Vec<_> = std::iter::repeat_with(|| hash::new_rand(&mut rng)) .take(1000) .collect(); bencher.iter(|| { diff --git a/core/benches/crds_shards.rs b/core/benches/crds_shards.rs index 171d1970d..a020e7da3 100644 --- a/core/benches/crds_shards.rs +++ b/core/benches/crds_shards.rs @@ -7,14 +7,14 @@ use solana_core::contact_info::ContactInfo; use solana_core::crds::VersionedCrdsValue; use solana_core::crds_shards::CrdsShards; use solana_core::crds_value::{CrdsData, CrdsValue}; -use solana_sdk::pubkey::Pubkey; +use solana_sdk::pubkey; use solana_sdk::timing::timestamp; use test::Bencher; const CRDS_SHARDS_BITS: u32 = 8; fn new_test_crds_value() -> VersionedCrdsValue { - let data = CrdsData::ContactInfo(ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp())); + let data = CrdsData::ContactInfo(ContactInfo::new_localhost(&pubkey::new_rand(), timestamp())); VersionedCrdsValue::new(timestamp(), CrdsValue::new_unsigned(data)) } diff --git a/core/benches/retransmit_stage.rs b/core/benches/retransmit_stage.rs index 5f6474863..1a6be8018 100644 --- a/core/benches/retransmit_stage.rs +++ b/core/benches/retransmit_stage.rs @@ -14,7 +14,7 @@ use solana_perf::packet::to_packets_chunked; use solana_perf::test_tx::test_tx; use solana_runtime::bank::Bank; use solana_runtime::bank_forks::BankForks; -use solana_sdk::pubkey::Pubkey; +use solana_sdk::pubkey; use solana_sdk::timing::timestamp; use std::net::UdpSocket; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -34,7 +34,7 @@ fn bench_retransmitter(bencher: &mut Bencher) { const NUM_PEERS: usize = 4; let mut peer_sockets = Vec::new(); for _ in 0..NUM_PEERS { - let id = solana_sdk::pubkey::new_rand(); + let id = pubkey::new_rand(); let socket = UdpSocket::bind("0.0.0.0:0").unwrap(); let mut contact_info = ContactInfo::new_localhost(&id, timestamp()); contact_info.tvu = socket.local_addr().unwrap(); diff --git a/core/src/broadcast_stage/broadcast_fake_shreds_run.rs b/core/src/broadcast_stage/broadcast_fake_shreds_run.rs index 664975ed5..ce512c6a0 100644 --- a/core/src/broadcast_stage/broadcast_fake_shreds_run.rs +++ b/core/src/broadcast_stage/broadcast_fake_shreds_run.rs @@ -140,7 +140,6 @@ impl BroadcastRun for BroadcastFakeShredsRun { mod tests { use super::*; use crate::contact_info::ContactInfo; - use solana_sdk::pubkey::Pubkey; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; #[test] diff --git a/core/src/cluster_info.rs b/core/src/cluster_info.rs index ac4dab091..afe5f84fe 100644 --- a/core/src/cluster_info.rs +++ b/core/src/cluster_info.rs @@ -2736,8 +2736,11 @@ mod tests { //check that a gossip nodes always show up as spies let (node, _, _) = ClusterInfo::spy_node(&solana_sdk::pubkey::new_rand(), 0); assert!(ClusterInfo::is_spy_node(&node)); - let (node, _, _) = - ClusterInfo::gossip_node(&solana_sdk::pubkey::new_rand(), &"1.1.1.1:1111".parse().unwrap(), 0); + let (node, _, _) = ClusterInfo::gossip_node( + &solana_sdk::pubkey::new_rand(), + &"1.1.1.1:1111".parse().unwrap(), + 0, + ); assert!(ClusterInfo::is_spy_node(&node)); } @@ -2955,8 +2958,12 @@ mod tests { let ip = IpAddr::V4(Ipv4Addr::from(0)); let port = bind_in_range(ip, port_range).expect("Failed to bind").0; - let node = - Node::new_with_external_ip(&solana_sdk::pubkey::new_rand(), &socketaddr!(0, port), port_range, ip); + let node = Node::new_with_external_ip( + &solana_sdk::pubkey::new_rand(), + &socketaddr!(0, port), + port_range, + ip, + ); check_node_sockets(&node, ip, port_range); diff --git a/core/src/commitment_service.rs b/core/src/commitment_service.rs index 24e1437d5..7742c7e1a 100644 --- a/core/src/commitment_service.rs +++ b/core/src/commitment_service.rs @@ -377,17 +377,20 @@ mod tests { let sk1 = solana_sdk::pubkey::new_rand(); let pk1 = solana_sdk::pubkey::new_rand(); - let mut vote_account1 = vote_state::create_account(&pk1, &solana_sdk::pubkey::new_rand(), 0, 100); + let mut vote_account1 = + vote_state::create_account(&pk1, &solana_sdk::pubkey::new_rand(), 0, 100); let stake_account1 = stake_state::create_account(&sk1, &pk1, &vote_account1, &genesis_config.rent, 100); let sk2 = solana_sdk::pubkey::new_rand(); let pk2 = solana_sdk::pubkey::new_rand(); - let mut vote_account2 = vote_state::create_account(&pk2, &solana_sdk::pubkey::new_rand(), 0, 50); + let mut vote_account2 = + vote_state::create_account(&pk2, &solana_sdk::pubkey::new_rand(), 0, 50); let stake_account2 = stake_state::create_account(&sk2, &pk2, &vote_account2, &genesis_config.rent, 50); let sk3 = solana_sdk::pubkey::new_rand(); let pk3 = solana_sdk::pubkey::new_rand(); - let mut vote_account3 = vote_state::create_account(&pk3, &solana_sdk::pubkey::new_rand(), 0, 1); + let mut vote_account3 = + vote_state::create_account(&pk3, &solana_sdk::pubkey::new_rand(), 0, 1); let stake_account3 = stake_state::create_account( &sk3, &pk3, @@ -397,7 +400,8 @@ mod tests { ); let sk4 = solana_sdk::pubkey::new_rand(); let pk4 = solana_sdk::pubkey::new_rand(); - let mut vote_account4 = vote_state::create_account(&pk4, &solana_sdk::pubkey::new_rand(), 0, 1); + let mut vote_account4 = + vote_state::create_account(&pk4, &solana_sdk::pubkey::new_rand(), 0, 1); let stake_account4 = stake_state::create_account( &sk4, &pk4, diff --git a/core/src/crds.rs b/core/src/crds.rs index cfab54459..3182011e6 100644 --- a/core/src/crds.rs +++ b/core/src/crds.rs @@ -361,7 +361,9 @@ mod test { } let mut crds = Crds::default(); - let pubkeys: Vec<_> = std::iter::repeat_with(solana_sdk::pubkey::new_rand).take(256).collect(); + let pubkeys: Vec<_> = std::iter::repeat_with(solana_sdk::pubkey::new_rand) + .take(256) + .collect(); let mut rng = thread_rng(); let mut num_inserts = 0; for _ in 0..4096 { diff --git a/core/src/crds_shards.rs b/core/src/crds_shards.rs index 60676304c..9ff54628a 100644 --- a/core/src/crds_shards.rs +++ b/core/src/crds_shards.rs @@ -135,14 +135,15 @@ mod test { use crate::contact_info::ContactInfo; use crate::crds_value::{CrdsData, CrdsValue}; use rand::{thread_rng, Rng}; - use solana_sdk::pubkey::Pubkey; use solana_sdk::timing::timestamp; use std::collections::HashSet; use std::ops::Index; fn new_test_crds_value() -> VersionedCrdsValue { - let data = - CrdsData::ContactInfo(ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp())); + let data = CrdsData::ContactInfo(ContactInfo::new_localhost( + &solana_sdk::pubkey::new_rand(), + timestamp(), + )); VersionedCrdsValue::new(timestamp(), CrdsValue::new_unsigned(data)) } diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index 5526ce07a..bbac7babe 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -2596,7 +2596,11 @@ pub(crate) mod tests { .is_none()); let bank1 = Bank::new_from_parent(&arc_bank0, &Pubkey::default(), arc_bank0.slot() + 1); - let _res = bank1.transfer(10, &genesis_config_info.mint_keypair, &solana_sdk::pubkey::new_rand()); + let _res = bank1.transfer( + 10, + &genesis_config_info.mint_keypair, + &solana_sdk::pubkey::new_rand(), + ); for _ in 0..genesis_config.ticks_per_slot { bank1.register_tick(&Hash::default()); } @@ -2612,7 +2616,11 @@ pub(crate) mod tests { ); let bank2 = Bank::new_from_parent(&arc_bank1, &Pubkey::default(), arc_bank1.slot() + 1); - let _res = bank2.transfer(10, &genesis_config_info.mint_keypair, &solana_sdk::pubkey::new_rand()); + let _res = bank2.transfer( + 10, + &genesis_config_info.mint_keypair, + &solana_sdk::pubkey::new_rand(), + ); for _ in 0..genesis_config.ticks_per_slot { bank2.register_tick(&Hash::default()); } diff --git a/core/src/retransmit_stage.rs b/core/src/retransmit_stage.rs index c15116305..e32a75270 100644 --- a/core/src/retransmit_stage.rs +++ b/core/src/retransmit_stage.rs @@ -504,7 +504,6 @@ mod tests { use solana_ledger::genesis_utils::{create_genesis_config, GenesisConfigInfo}; use solana_net_utils::find_available_port_in_range; use solana_perf::packet::{Meta, Packet, Packets}; - use solana_sdk::pubkey::Pubkey; use std::net::{IpAddr, Ipv4Addr}; #[test] diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 9bd9d88f6..c33354543 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -4271,8 +4271,12 @@ pub mod tests { ); SendTransactionService::new(tpu_address, &bank_forks, None, receiver); - let mut bad_transaction = - system_transaction::transfer(&mint_keypair, &solana_sdk::pubkey::new_rand(), 42, Hash::default()); + let mut bad_transaction = system_transaction::transfer( + &mint_keypair, + &solana_sdk::pubkey::new_rand(), + 42, + Hash::default(), + ); // sendTransaction will fail because the blockhash is invalid let req = format!( @@ -4302,8 +4306,12 @@ pub mod tests { r#"{"jsonrpc":"2.0","error":{"code":-32002,"message":"Transaction simulation failed: Transaction failed to sanitize accounts offsets correctly","data":{"err":"SanitizeFailure","logs":[]}},"id":1}"#.to_string(), ) ); - let mut bad_transaction = - system_transaction::transfer(&mint_keypair, &solana_sdk::pubkey::new_rand(), 42, recent_blockhash); + let mut bad_transaction = system_transaction::transfer( + &mint_keypair, + &solana_sdk::pubkey::new_rand(), + 42, + recent_blockhash, + ); // sendTransaction will fail due to poor node health health.stub_set_health_status(Some(RpcHealthStatus::Behind)); @@ -4397,7 +4405,12 @@ pub mod tests { #[test] fn test_rpc_verify_signature() { - let tx = system_transaction::transfer(&Keypair::new(), &solana_sdk::pubkey::new_rand(), 20, hash(&[0])); + let tx = system_transaction::transfer( + &Keypair::new(), + &solana_sdk::pubkey::new_rand(), + 20, + hash(&[0]), + ); assert_eq!( verify_signature(&tx.signatures[0].to_string()).unwrap(), tx.signatures[0] @@ -5192,7 +5205,8 @@ pub mod tests { #[test] fn test_token_rpcs() { - let RpcHandler { io, meta, bank, .. } = start_rpc_handler_with_tx(&solana_sdk::pubkey::new_rand()); + let RpcHandler { io, meta, bank, .. } = + start_rpc_handler_with_tx(&solana_sdk::pubkey::new_rand()); let mut account_data = vec![0; TokenAccount::get_packed_len()]; let mint = SplTokenPubkey::new(&[2; 32]); @@ -5588,7 +5602,8 @@ pub mod tests { #[test] fn test_token_parsing() { - let RpcHandler { io, meta, bank, .. } = start_rpc_handler_with_tx(&solana_sdk::pubkey::new_rand()); + let RpcHandler { io, meta, bank, .. } = + start_rpc_handler_with_tx(&solana_sdk::pubkey::new_rand()); let mut account_data = vec![0; TokenAccount::get_packed_len()]; let mint = SplTokenPubkey::new(&[2; 32]); diff --git a/core/src/rpc_service.rs b/core/src/rpc_service.rs index 3229585d5..43b9566e2 100644 --- a/core/src/rpc_service.rs +++ b/core/src/rpc_service.rs @@ -550,7 +550,11 @@ mod tests { let cluster_info = Arc::new(ClusterInfo::default()); let health_check_slot_distance = 123; let override_health_check = Arc::new(AtomicBool::new(false)); - let trusted_validators = vec![solana_sdk::pubkey::new_rand(), solana_sdk::pubkey::new_rand(), solana_sdk::pubkey::new_rand()]; + let trusted_validators = vec![ + solana_sdk::pubkey::new_rand(), + solana_sdk::pubkey::new_rand(), + solana_sdk::pubkey::new_rand(), + ]; let health = Arc::new(RpcHealth::new( cluster_info.clone(), diff --git a/core/src/rpc_subscriptions.rs b/core/src/rpc_subscriptions.rs index b497f8261..0e7147285 100644 --- a/core/src/rpc_subscriptions.rs +++ b/core/src/rpc_subscriptions.rs @@ -1249,8 +1249,11 @@ pub(crate) mod tests { .process_transaction(&past_bank_tx) .unwrap(); - let next_bank = - Bank::new_from_parent(&bank_forks.banks[&0].clone(), &solana_sdk::pubkey::new_rand(), 1); + let next_bank = Bank::new_from_parent( + &bank_forks.banks[&0].clone(), + &solana_sdk::pubkey::new_rand(), + 1, + ); bank_forks.insert(next_bank); bank_forks diff --git a/core/src/serve_repair.rs b/core/src/serve_repair.rs index 9543118ab..aa8b661a3 100644 --- a/core/src/serve_repair.rs +++ b/core/src/serve_repair.rs @@ -971,8 +971,10 @@ mod tests { let cluster_info = Arc::new(ClusterInfo::new_with_invalid_keypair(me.clone())); // Insert two peers on the network - let contact_info2 = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp()); - let contact_info3 = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp()); + let contact_info2 = + ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp()); + let contact_info3 = + ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp()); cluster_info.insert_info(contact_info2.clone()); cluster_info.insert_info(contact_info3.clone()); let serve_repair = ServeRepair::new(cluster_info); diff --git a/core/src/verified_vote_packets.rs b/core/src/verified_vote_packets.rs index b6fc262d8..280ddcaa8 100644 --- a/core/src/verified_vote_packets.rs +++ b/core/src/verified_vote_packets.rs @@ -59,7 +59,6 @@ mod tests { use crate::result::Error; use crossbeam_channel::{unbounded, RecvTimeoutError}; use solana_perf::packet::{Meta, Packet}; - use solana_sdk::pubkey::Pubkey; #[test] fn test_get_latest_votes() { diff --git a/core/tests/client.rs b/core/tests/client.rs index 48aa8d73d..2fa2a05c7 100644 --- a/core/tests/client.rs +++ b/core/tests/client.rs @@ -12,8 +12,7 @@ use solana_runtime::{ genesis_utils::{create_genesis_config, GenesisConfigInfo}, }; use solana_sdk::{ - commitment_config::CommitmentConfig, pubkey::Pubkey, rpc_port, signature::Signer, - system_transaction, + commitment_config::CommitmentConfig, rpc_port, signature::Signer, system_transaction, }; use std::{ fs::remove_dir_all, diff --git a/core/tests/rpc.rs b/core/tests/rpc.rs index 44748a225..505b5c0e7 100644 --- a/core/tests/rpc.rs +++ b/core/tests/rpc.rs @@ -15,8 +15,8 @@ use solana_client::{ use solana_core::contact_info::ContactInfo; use solana_core::{rpc_pubsub::gen_client::Client as PubsubClient, test_validator::TestValidator}; use solana_sdk::{ - commitment_config::CommitmentConfig, hash::Hash, pubkey::Pubkey, signature::Signer, - system_transaction, transaction::Transaction, + commitment_config::CommitmentConfig, hash::Hash, signature::Signer, system_transaction, + transaction::Transaction, }; use std::{ collections::HashSet, @@ -173,7 +173,9 @@ fn test_rpc_subscriptions() { // Create transaction signatures to subscribe to let transactions: Vec = (0..1000) - .map(|_| system_transaction::transfer(&alice, &solana_sdk::pubkey::new_rand(), 1, genesis_hash)) + .map(|_| { + system_transaction::transfer(&alice, &solana_sdk::pubkey::new_rand(), 1, genesis_hash) + }) .collect(); let mut signature_set: HashSet = transactions .iter() diff --git a/dos/src/main.rs b/dos/src/main.rs index 69b20508d..4d32273bc 100644 --- a/dos/src/main.rs +++ b/dos/src/main.rs @@ -253,7 +253,10 @@ pub mod test { #[test] fn test_dos() { - let nodes = [ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp())]; + let nodes = [ContactInfo::new_localhost( + &solana_sdk::pubkey::new_rand(), + timestamp(), + )]; let entrypoint_addr = nodes[0].gossip; run_dos( &nodes, diff --git a/faucet/tests/local-faucet.rs b/faucet/tests/local-faucet.rs index 399a0a645..28ec2f02f 100644 --- a/faucet/tests/local-faucet.rs +++ b/faucet/tests/local-faucet.rs @@ -2,7 +2,6 @@ use solana_faucet::faucet::{request_airdrop_transaction, run_local_faucet}; use solana_sdk::{ hash::Hash, message::Message, - pubkey::Pubkey, signature::{Keypair, Signer}, system_instruction, transaction::Transaction, diff --git a/genesis/src/main.rs b/genesis/src/main.rs index b13e188d9..b1cc646ec 100644 --- a/genesis/src/main.rs +++ b/genesis/src/main.rs @@ -615,7 +615,6 @@ fn main() -> Result<(), Box> { mod tests { use super::*; use solana_sdk::genesis_config::GenesisConfig; - use solana_sdk::pubkey::Pubkey; use std::collections::HashMap; use std::fs::remove_file; use std::io::Write; diff --git a/ledger/benches/protobuf.rs b/ledger/benches/protobuf.rs index 0d4442a75..27d7b6bb1 100644 --- a/ledger/benches/protobuf.rs +++ b/ledger/benches/protobuf.rs @@ -8,7 +8,7 @@ use solana_ledger::{ get_tmp_ledger_path, }; use solana_runtime::bank::RewardType; -use solana_sdk::{clock::Slot, pubkey::Pubkey}; +use solana_sdk::{clock::Slot, pubkey}; use solana_transaction_status::{Reward, Rewards}; use std::path::Path; use test::Bencher; @@ -16,7 +16,7 @@ use test::Bencher; fn create_rewards() -> Rewards { (0..100) .map(|i| Reward { - pubkey: solana_sdk::pubkey::new_rand().to_string(), + pubkey: pubkey::new_rand().to_string(), lamports: 42 + i, post_balance: std::u64::MAX, reward_type: Some(RewardType::Fee), diff --git a/ledger/src/blockstore_processor.rs b/ledger/src/blockstore_processor.rs index 04c0b92f0..28f17ff68 100644 --- a/ledger/src/blockstore_processor.rs +++ b/ledger/src/blockstore_processor.rs @@ -2872,8 +2872,12 @@ pub mod tests { let keypair = Keypair::new(); // Create array of two transactions which throw different errors - let account_not_found_tx = - system_transaction::transfer(&keypair, &solana_sdk::pubkey::new_rand(), 42, bank.last_blockhash()); + let account_not_found_tx = system_transaction::transfer( + &keypair, + &solana_sdk::pubkey::new_rand(), + 42, + bank.last_blockhash(), + ); let account_not_found_sig = account_not_found_tx.signatures[0]; let mut account_loaded_twice = system_transaction::transfer( &mint_keypair, @@ -2925,7 +2929,11 @@ pub mod tests { let bank0 = Arc::new(Bank::new(&genesis_config)); bank0.freeze(); - 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, + )); // The new blockhash is going to be the hash of the last tick in the block let bank_1_blockhash = bank1.last_blockhash(); diff --git a/ledger/src/genesis_utils.rs b/ledger/src/genesis_utils.rs index 65ca0a918..6d1e12409 100644 --- a/ledger/src/genesis_utils.rs +++ b/ledger/src/genesis_utils.rs @@ -2,7 +2,6 @@ pub use solana_runtime::genesis_utils::{ create_genesis_config_with_leader, create_genesis_config_with_leader_ex, GenesisConfigInfo, BOOTSTRAP_VALIDATOR_LAMPORTS, }; -use solana_sdk::pubkey::Pubkey; // same as genesis_config::create_genesis_config, but with bootstrap_validator staking logic // for the core crate tests diff --git a/ledger/src/leader_schedule.rs b/ledger/src/leader_schedule.rs index 31c7ce89e..e2ca2662b 100644 --- a/ledger/src/leader_schedule.rs +++ b/ledger/src/leader_schedule.rs @@ -77,7 +77,9 @@ mod tests { #[test] fn test_leader_schedule_basic() { let num_keys = 10; - let stakes: Vec<_> = (0..num_keys).map(|i| (solana_sdk::pubkey::new_rand(), i)).collect(); + let stakes: Vec<_> = (0..num_keys) + .map(|i| (solana_sdk::pubkey::new_rand(), i)) + .collect(); let seed = solana_sdk::pubkey::new_rand(); let mut seed_bytes = [0u8; 32]; @@ -93,7 +95,9 @@ mod tests { #[test] fn test_repeated_leader_schedule() { let num_keys = 10; - let stakes: Vec<_> = (0..num_keys).map(|i| (solana_sdk::pubkey::new_rand(), i)).collect(); + let stakes: Vec<_> = (0..num_keys) + .map(|i| (solana_sdk::pubkey::new_rand(), i)) + .collect(); let seed = solana_sdk::pubkey::new_rand(); let mut seed_bytes = [0u8; 32]; diff --git a/local-cluster/tests/local_cluster.rs b/local-cluster/tests/local_cluster.rs index 79b7870fd..a214c636a 100644 --- a/local-cluster/tests/local_cluster.rs +++ b/local-cluster/tests/local_cluster.rs @@ -162,8 +162,12 @@ fn test_local_cluster_signature_subscribe() { .get_recent_blockhash_with_commitment(CommitmentConfig::recent()) .unwrap(); - let mut transaction = - system_transaction::transfer(&cluster.funding_keypair, &solana_sdk::pubkey::new_rand(), 10, blockhash); + let mut transaction = system_transaction::transfer( + &cluster.funding_keypair, + &solana_sdk::pubkey::new_rand(), + 10, + blockhash, + ); let (mut sig_subscribe_client, receiver) = PubsubClient::signature_subscribe( &format!("ws://{}", &non_bootstrap_info.rpc_pubsub.to_string()), @@ -815,7 +819,12 @@ fn generate_frozen_account_panic(mut cluster: LocalCluster, frozen_account: Arc< .get_recent_blockhash_with_commitment(CommitmentConfig::recent()) .unwrap(); client - .async_transfer(1, &frozen_account, &solana_sdk::pubkey::new_rand(), blockhash) + .async_transfer( + 1, + &frozen_account, + &solana_sdk::pubkey::new_rand(), + blockhash, + ) .unwrap(); sleep(Duration::from_secs(1)); diff --git a/programs/bpf_loader/src/serialization.rs b/programs/bpf_loader/src/serialization.rs index 9fec0f046..b2d0948dd 100644 --- a/programs/bpf_loader/src/serialization.rs +++ b/programs/bpf_loader/src/serialization.rs @@ -264,7 +264,12 @@ mod tests { fn test_serialize_parameters() { let program_id = solana_sdk::pubkey::new_rand(); let dup_key = solana_sdk::pubkey::new_rand(); - let keys = vec![dup_key, dup_key, solana_sdk::pubkey::new_rand(), solana_sdk::pubkey::new_rand()]; + let keys = vec![ + dup_key, + dup_key, + solana_sdk::pubkey::new_rand(), + solana_sdk::pubkey::new_rand(), + ]; let accounts = [ RefCell::new(Account { lamports: 1, diff --git a/programs/failure/tests/failure.rs b/programs/failure/tests/failure.rs index 9bbc716a6..8194e66e7 100644 --- a/programs/failure/tests/failure.rs +++ b/programs/failure/tests/failure.rs @@ -4,7 +4,6 @@ use solana_runtime::loader_utils::create_invoke_instruction; use solana_sdk::client::SyncClient; use solana_sdk::genesis_config::create_genesis_config; use solana_sdk::instruction::InstructionError; -use solana_sdk::pubkey::Pubkey; use solana_sdk::signature::Signer; use solana_sdk::transaction::TransactionError; diff --git a/runtime/benches/accounts_index.rs b/runtime/benches/accounts_index.rs index 64f8f1120..5bf9f6d24 100644 --- a/runtime/benches/accounts_index.rs +++ b/runtime/benches/accounts_index.rs @@ -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; diff --git a/runtime/benches/message_processor.rs b/runtime/benches/message_processor.rs index 119a765fc..bf4d16d25 100644 --- a/runtime/benches/message_processor.rs +++ b/runtime/benches/message_processor.rs @@ -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, diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 0e4f74cdc..6fec1792c 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -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 ); } diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 758c1b833..9100e685f 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -610,7 +610,7 @@ mod tests { let root_slot = 0; let mut pubkeys: Vec = 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::>); 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()); } diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 6ab23a1a3..03a013952 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -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], diff --git a/runtime/src/bloom.rs b/runtime/src/bloom.rs index a49ccb9bf..4efea1f60 100644 --- a/runtime/src/bloom.rs +++ b/runtime/src/bloom.rs @@ -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); diff --git a/runtime/src/message_processor.rs b/runtime/src/message_processor.rs index 3e8833eb0..e355c8c28 100644 --- a/runtime/src/message_processor.rs +++ b/runtime/src/message_processor.rs @@ -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()); diff --git a/runtime/src/rent_collector.rs b/runtime/src/rent_collector.rs index 441a9b572..655ee6e0f 100644 --- a/runtime/src/rent_collector.rs +++ b/runtime/src/rent_collector.rs @@ -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, ); diff --git a/runtime/src/stakes.rs b/runtime/src/stakes.rs index 95cb89b68..4fd36b308 100644 --- a/runtime/src/stakes.rs +++ b/runtime/src/stakes.rs @@ -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), diff --git a/runtime/src/transaction_batch.rs b/runtime/src/transaction_batch.rs index 1fb64ea2e..5002927dd 100644 --- a/runtime/src/transaction_batch.rs +++ b/runtime/src/transaction_batch.rs @@ -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() { diff --git a/runtime/tests/bank.rs b/runtime/tests/bank.rs index 98aefcff5..5e9e118de 100644 --- a/runtime/tests/bank.rs +++ b/runtime/tests/bank.rs @@ -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] diff --git a/runtime/tests/noop.rs b/runtime/tests/noop.rs index 7a6b1cda0..f7233830b 100644 --- a/runtime/tests/noop.rs +++ b/runtime/tests/noop.rs @@ -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() { diff --git a/runtime/tests/stake.rs b/runtime/tests/stake.rs index 6efd3dc05..55b0bd65e 100644 --- a/runtime/tests/stake.rs +++ b/runtime/tests/stake.rs @@ -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); diff --git a/sdk/benches/serialize_instructions.rs b/sdk/benches/serialize_instructions.rs index 1bb605dbf..1dde1dd4d 100644 --- a/sdk/benches/serialize_instructions.rs +++ b/sdk/benches/serialize_instructions.rs @@ -4,13 +4,13 @@ extern crate test; use bincode::{deserialize, serialize}; use solana_sdk::instruction::{AccountMeta, Instruction}; use solana_sdk::message::Message; -use solana_sdk::pubkey::Pubkey; +use solana_sdk::pubkey; use solana_sdk::sysvar::instructions; use test::Bencher; fn make_instructions() -> Vec { - let meta = AccountMeta::new(solana_sdk::pubkey::new_rand(), false); - let inst = Instruction::new(solana_sdk::pubkey::new_rand(), &[0; 10], vec![meta; 4]); + let meta = AccountMeta::new(pubkey::new_rand(), false); + let inst = Instruction::new(pubkey::new_rand(), &[0; 10], vec![meta; 4]); vec![inst; 4] } diff --git a/sdk/src/genesis_config.rs b/sdk/src/genesis_config.rs index afc8ab9c1..58631b408 100644 --- a/sdk/src/genesis_config.rs +++ b/sdk/src/genesis_config.rs @@ -310,7 +310,10 @@ mod tests { faucet_keypair.pubkey(), Account::new(10_000, 0, &Pubkey::default()), ); - config.add_account(solana_sdk::pubkey::new_rand(), Account::new(1, 0, &Pubkey::default())); + config.add_account( + solana_sdk::pubkey::new_rand(), + Account::new(1, 0, &Pubkey::default()), + ); config.add_native_instruction_processor("hi".to_string(), solana_sdk::pubkey::new_rand()); assert_eq!(config.accounts.len(), 2); diff --git a/sdk/src/pubkey.rs b/sdk/src/pubkey.rs index 043732c23..c05e044a3 100644 --- a/sdk/src/pubkey.rs +++ b/sdk/src/pubkey.rs @@ -301,7 +301,12 @@ mod tests { #[test] fn test_create_with_seed() { - assert!(Pubkey::create_with_seed(&solana_sdk::pubkey::new_rand(), "☉", &solana_sdk::pubkey::new_rand()).is_ok()); + assert!(Pubkey::create_with_seed( + &solana_sdk::pubkey::new_rand(), + "☉", + &solana_sdk::pubkey::new_rand() + ) + .is_ok()); assert_eq!( Pubkey::create_with_seed( &solana_sdk::pubkey::new_rand(), @@ -337,7 +342,12 @@ mod tests { ) .is_ok()); - assert!(Pubkey::create_with_seed(&solana_sdk::pubkey::new_rand(), "", &solana_sdk::pubkey::new_rand(),).is_ok()); + assert!(Pubkey::create_with_seed( + &solana_sdk::pubkey::new_rand(), + "", + &solana_sdk::pubkey::new_rand(), + ) + .is_ok()); assert_eq!( Pubkey::create_with_seed( diff --git a/storage-bigtable/src/bigtable.rs b/storage-bigtable/src/bigtable.rs index 5bf8c95b2..a0ac3e733 100644 --- a/storage-bigtable/src/bigtable.rs +++ b/storage-bigtable/src/bigtable.rs @@ -635,7 +635,7 @@ mod tests { use super::*; use crate::StoredConfirmedBlock; use prost::Message; - use solana_sdk::{hash::Hash, pubkey::Pubkey, signature::Keypair, system_transaction}; + use solana_sdk::{hash::Hash, signature::Keypair, system_transaction}; use solana_storage_proto::convert::generated; use solana_transaction_status::{ ConfirmedBlock, TransactionStatusMeta, TransactionWithStatusMeta, diff --git a/transaction-status/src/parse_accounts.rs b/transaction-status/src/parse_accounts.rs index ea4434795..d20afd067 100644 --- a/transaction-status/src/parse_accounts.rs +++ b/transaction-status/src/parse_accounts.rs @@ -23,7 +23,7 @@ pub fn parse_accounts(message: &Message) -> Vec { #[cfg(test)] mod test { use super::*; - use solana_sdk::{message::MessageHeader, pubkey::Pubkey}; + use solana_sdk::message::MessageHeader; #[test] fn test_parse_accounts() { diff --git a/transaction-status/src/parse_bpf_loader.rs b/transaction-status/src/parse_bpf_loader.rs index 94cbc2cde..2f16712bc 100644 --- a/transaction-status/src/parse_bpf_loader.rs +++ b/transaction-status/src/parse_bpf_loader.rs @@ -37,15 +37,15 @@ pub fn parse_bpf_loader( #[cfg(test)] mod test { use super::*; - use solana_sdk::{message::Message, pubkey::Pubkey}; + use solana_sdk::{message::Message, pubkey}; #[test] fn test_parse_bpf_loader_instructions() { - let account_pubkey = solana_sdk::pubkey::new_rand(); - let program_id = solana_sdk::pubkey::new_rand(); + let account_pubkey = pubkey::new_rand(); + let program_id = pubkey::new_rand(); let offset = 4242; let bytes = vec![8; 99]; - let fee_payer = solana_sdk::pubkey::new_rand(); + let fee_payer = pubkey::new_rand(); let account_keys = vec![fee_payer, account_pubkey]; let missing_account_keys = vec![account_pubkey];