Reformat imports to a consistent style for imports

rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
This commit is contained in:
Michael Vines
2021-12-03 09:00:31 -08:00
parent 0ef1b25e4b
commit b8837c04ec
397 changed files with 5990 additions and 5175 deletions

View File

@ -183,17 +183,19 @@ impl Default for BlockhashQuery {
#[cfg(test)]
mod tests {
use super::*;
use crate::{
blockhash_query,
rpc_request::RpcRequest,
rpc_response::{Response, RpcFeeCalculator, RpcFees, RpcResponseContext},
use {
super::*,
crate::{
blockhash_query,
rpc_request::RpcRequest,
rpc_response::{Response, RpcFeeCalculator, RpcFees, RpcResponseContext},
},
clap::App,
serde_json::{self, json},
solana_account_decoder::{UiAccount, UiAccountEncoding},
solana_sdk::{account::Account, hash::hash, nonce, system_program},
std::collections::HashMap,
};
use clap::App;
use serde_json::{self, json};
use solana_account_decoder::{UiAccount, UiAccountEncoding};
use solana_sdk::{account::Account, hash::hash, nonce, system_program};
use std::collections::HashMap;
#[test]
fn test_blockhash_query_new_ok() {

View File

@ -1,3 +1,4 @@
pub use reqwest;
use {
crate::{rpc_request, rpc_response},
solana_faucet::faucet::FaucetError,
@ -6,9 +7,7 @@ use {
},
std::io,
thiserror::Error,
};
pub use reqwest; // export `reqwest` for clients
}; // export `reqwest` for clients
#[derive(Error, Debug)]
pub enum ClientErrorKind {

View File

@ -16,8 +16,7 @@ use {
client_error::{ClientError, ClientErrorKind, Result as ClientResult},
http_sender::HttpSender,
mock_sender::{MockSender, Mocks},
rpc_config::RpcAccountInfoConfig,
rpc_config::*,
rpc_config::{RpcAccountInfoConfig, *},
rpc_request::{RpcError, RpcRequest, RpcResponseErrorData, TokenAccountsFilter},
rpc_response::*,
rpc_sender::*,
@ -4937,19 +4936,21 @@ pub fn create_rpc_client_mocks() -> crate::mock_sender::Mocks {
#[cfg(test)]
mod tests {
use super::*;
use crate::{client_error::ClientErrorKind, mock_sender::PUBKEY};
use assert_matches::assert_matches;
use jsonrpc_core::{futures::prelude::*, Error, IoHandler, Params};
use jsonrpc_http_server::{AccessControlAllowOrigin, DomainsValidation, ServerBuilder};
use serde_json::Number;
use solana_sdk::{
instruction::InstructionError,
signature::{Keypair, Signer},
system_transaction,
transaction::TransactionError,
use {
super::*,
crate::{client_error::ClientErrorKind, mock_sender::PUBKEY},
assert_matches::assert_matches,
jsonrpc_core::{futures::prelude::*, Error, IoHandler, Params},
jsonrpc_http_server::{AccessControlAllowOrigin, DomainsValidation, ServerBuilder},
serde_json::Number,
solana_sdk::{
instruction::InstructionError,
signature::{Keypair, Signer},
system_transaction,
transaction::TransactionError,
},
std::{io, sync::mpsc::channel, thread},
};
use std::{io, sync::mpsc::channel, thread};
#[test]
fn test_send() {

View File

@ -1,9 +1,9 @@
//! Implementation defined RPC server errors
use thiserror::Error;
use {
crate::rpc_response::RpcSimulateTransactionResult,
jsonrpc_core::{Error, ErrorCode},
solana_sdk::clock::Slot,
thiserror::Error,
};
pub const JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: i64 = -32001;

View File

@ -267,9 +267,11 @@ pub enum TokenAccountsFilter {
#[cfg(test)]
mod tests {
use super::*;
use crate::rpc_config::RpcTokenAccountsFilter;
use solana_sdk::commitment_config::{CommitmentConfig, CommitmentLevel};
use {
super::*,
crate::rpc_config::RpcTokenAccountsFilter,
solana_sdk::commitment_config::{CommitmentConfig, CommitmentLevel},
};
#[test]
fn test_build_request_json() {

View File

@ -667,8 +667,7 @@ pub fn create_client_with_timeout(
#[cfg(test)]
mod tests {
use super::*;
use rayon::prelude::*;
use {super::*, rayon::prelude::*};
#[test]
fn test_client_optimizer() {

View File

@ -1,34 +1,36 @@
use crate::{
client_error::ClientError,
pubsub_client::{PubsubClient, PubsubClientError, PubsubClientSubscription},
rpc_client::RpcClient,
rpc_request::MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS,
rpc_response::SlotUpdate,
spinner,
};
use bincode::serialize;
use log::*;
use solana_sdk::{
clock::Slot,
commitment_config::CommitmentConfig,
message::Message,
pubkey::Pubkey,
signature::SignerError,
signers::Signers,
transaction::{Transaction, TransactionError},
};
use std::{
collections::{HashMap, HashSet, VecDeque},
net::{SocketAddr, UdpSocket},
str::FromStr,
sync::{
atomic::{AtomicBool, Ordering},
Arc, RwLock,
use {
crate::{
client_error::ClientError,
pubsub_client::{PubsubClient, PubsubClientError, PubsubClientSubscription},
rpc_client::RpcClient,
rpc_request::MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS,
rpc_response::SlotUpdate,
spinner,
},
thread::{sleep, JoinHandle},
time::{Duration, Instant},
bincode::serialize,
log::*,
solana_sdk::{
clock::Slot,
commitment_config::CommitmentConfig,
message::Message,
pubkey::Pubkey,
signature::SignerError,
signers::Signers,
transaction::{Transaction, TransactionError},
},
std::{
collections::{HashMap, HashSet, VecDeque},
net::{SocketAddr, UdpSocket},
str::FromStr,
sync::{
atomic::{AtomicBool, Ordering},
Arc, RwLock,
},
thread::{sleep, JoinHandle},
time::{Duration, Instant},
},
thiserror::Error,
};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum TpuSenderError {

View File

@ -1,19 +1,21 @@
#![allow(clippy::integer_arithmetic)]
use crate::rpc_client::RpcClient;
use log::*;
use solana_measure::measure::Measure;
use solana_sdk::{
commitment_config::CommitmentConfig, signature::Signature, timing::timestamp,
transaction::Transaction,
};
use std::{
net::SocketAddr,
sync::{
atomic::{AtomicBool, AtomicU64, Ordering},
Arc, RwLock,
use {
crate::rpc_client::RpcClient,
log::*,
solana_measure::measure::Measure,
solana_sdk::{
commitment_config::CommitmentConfig, signature::Signature, timing::timestamp,
transaction::Transaction,
},
std::{
net::SocketAddr,
sync::{
atomic::{AtomicBool, AtomicU64, Ordering},
Arc, RwLock,
},
thread::{sleep, Builder, JoinHandle},
time::{Duration, Instant},
},
thread::{sleep, Builder, JoinHandle},
time::{Duration, Instant},
};
// signature, timestamp, id