Skip to content

Commit

Permalink
moved unnecessary use to cfg(test)
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillLykov committed Nov 5, 2024
1 parent 808d2c2 commit 892a5a3
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ use {
accounts::AccountAddressFilter,
accounts_index::{AccountIndex, AccountSecondaryIndexes, IndexKey, ScanConfig},
},
solana_client::connection_cache::{ConnectionCache, Protocol},
solana_client::connection_cache::Protocol,
solana_entry::entry::Entry,
solana_faucet::faucet::request_airdrop_transaction,
solana_feature_set as feature_set,
solana_gossip::{cluster_info::ClusterInfo, contact_info::ContactInfo},
solana_gossip::cluster_info::ClusterInfo,
solana_inline_spl::{
token::{SPL_TOKEN_ACCOUNT_MINT_OFFSET, SPL_TOKEN_ACCOUNT_OWNER_OFFSET},
token_2022::{self, ACCOUNTTYPE_ACCOUNT},
Expand All @@ -33,7 +33,6 @@ use {
blockstore::{Blockstore, SignatureInfosForAddress},
blockstore_db::BlockstoreError,
blockstore_meta::{PerfSample, PerfSampleV1, PerfSampleV2},
get_tmp_ledger_path,
leader_schedule_cache::LeaderScheduleCache,
},
solana_metrics::inc_new_counter_info,
Expand All @@ -54,7 +53,7 @@ use {
solana_runtime::{
bank::{Bank, TransactionSimulationResult},
bank_forks::BankForks,
commitment::{BlockCommitmentArray, BlockCommitmentCache, CommitmentSlots},
commitment::{BlockCommitmentArray, BlockCommitmentCache},
installed_scheduler_pool::BankWithScheduler,
non_circulating_supply::calculate_non_circulating_supply,
prioritization_fee_cache::PrioritizationFeeCache,
Expand All @@ -81,13 +80,9 @@ use {
VersionedTransaction, MAX_TX_ACCOUNT_LOCKS,
},
},
solana_send_transaction_service::{
send_transaction_service::{SendTransactionService, TransactionInfo},
tpu_info::NullTpuInfo,
},
solana_send_transaction_service::send_transaction_service::TransactionInfo,
solana_stake_program,
solana_storage_bigtable::Error as StorageError,
solana_streamer::socket::SocketAddrSpace,
solana_transaction_status::{
map_inner_instructions, BlockEncodingOptions, ConfirmedBlock,
ConfirmedTransactionStatusWithSignature, ConfirmedTransactionWithStatusMeta,
Expand Down Expand Up @@ -119,6 +114,18 @@ use {
},
};

#[cfg(test)]
use {
solana_client::connection_cache::ConnectionCache,
solana_gossip::contact_info::ContactInfo,
solana_ledger::get_tmp_ledger_path,
solana_runtime::commitment::CommitmentSlots,
solana_send_transaction_service::{
send_transaction_service::SendTransactionService, tpu_info::NullTpuInfo,
},
solana_streamer::socket::SocketAddrSpace,
};

pub mod account_resolver;

type RpcCustomResult<T> = std::result::Result<T, RpcCustomError>;
Expand Down Expand Up @@ -4333,11 +4340,12 @@ pub mod tests {
serde::de::DeserializeOwned,
solana_accounts_db::accounts_db::{AccountsDbConfig, ACCOUNTS_DB_CONFIG_FOR_TESTING},
solana_entry::entry::next_versioned_entry,
solana_gossip::socketaddr,
solana_gossip::{contact_info::ContactInfo, socketaddr},
solana_ledger::{
blockstore_meta::PerfSampleV2,
blockstore_processor::fill_blockstore_slot_with_ticks,
genesis_utils::{create_genesis_config, GenesisConfigInfo},
get_tmp_ledger_path,
},
solana_rpc_client_api::{
custom_error::{
Expand All @@ -4348,8 +4356,10 @@ pub mod tests {
filter::MemcmpEncodedBytes,
},
solana_runtime::{
accounts_background_service::AbsRequestSender, bank::BankTestConfig,
commitment::BlockCommitment, non_circulating_supply::non_circulating_accounts,
accounts_background_service::AbsRequestSender,
bank::BankTestConfig,
commitment::{BlockCommitment, CommitmentSlots},
non_circulating_supply::non_circulating_accounts,
},
solana_sdk::{
account::{Account, WritableAccount},
Expand Down Expand Up @@ -4377,6 +4387,7 @@ pub mod tests {
},
vote::state::VoteState,
},
solana_send_transaction_service::tpu_info::NullTpuInfo,
solana_transaction_status::{
EncodedConfirmedBlock, EncodedTransaction, EncodedTransactionWithStatusMeta,
TransactionDetails,
Expand Down

0 comments on commit 892a5a3

Please sign in to comment.