Reformat imports to a consistent style for imports
rustfmt.toml configuration: imports_granularity = "One" group_imports = "One"
This commit is contained in:
@ -1,19 +1,21 @@
|
||||
use crate::args::{
|
||||
Args, BalancesArgs, Command, DistributeTokensArgs, SenderStakeArgs, SplTokenArgs, StakeArgs,
|
||||
TransactionLogArgs,
|
||||
use {
|
||||
crate::args::{
|
||||
Args, BalancesArgs, Command, DistributeTokensArgs, SenderStakeArgs, SplTokenArgs,
|
||||
StakeArgs, TransactionLogArgs,
|
||||
},
|
||||
clap::{
|
||||
crate_description, crate_name, value_t, value_t_or_exit, App, Arg, ArgMatches, SubCommand,
|
||||
},
|
||||
solana_clap_utils::{
|
||||
input_parsers::{pubkey_of_signer, value_of},
|
||||
input_validators::{is_amount, is_valid_pubkey, is_valid_signer},
|
||||
keypair::{pubkey_from_path, signer_from_path},
|
||||
},
|
||||
solana_cli_config::CONFIG_FILE,
|
||||
solana_remote_wallet::remote_wallet::maybe_wallet_manager,
|
||||
solana_sdk::native_token::sol_to_lamports,
|
||||
std::{error::Error, ffi::OsString, process::exit},
|
||||
};
|
||||
use clap::{
|
||||
crate_description, crate_name, value_t, value_t_or_exit, App, Arg, ArgMatches, SubCommand,
|
||||
};
|
||||
use solana_clap_utils::{
|
||||
input_parsers::{pubkey_of_signer, value_of},
|
||||
input_validators::{is_amount, is_valid_pubkey, is_valid_signer},
|
||||
keypair::{pubkey_from_path, signer_from_path},
|
||||
};
|
||||
use solana_cli_config::CONFIG_FILE;
|
||||
use solana_remote_wallet::remote_wallet::maybe_wallet_manager;
|
||||
use solana_sdk::native_token::sol_to_lamports;
|
||||
use std::{error::Error, ffi::OsString, process::exit};
|
||||
|
||||
fn get_matches<'a, I, T>(args: I) -> ArgMatches<'a>
|
||||
where
|
||||
|
@ -1,51 +1,55 @@
|
||||
use crate::{
|
||||
args::{BalancesArgs, DistributeTokensArgs, SenderStakeArgs, StakeArgs, TransactionLogArgs},
|
||||
db::{self, TransactionInfo},
|
||||
spl_token::*,
|
||||
token_display::Token,
|
||||
};
|
||||
use chrono::prelude::*;
|
||||
use console::style;
|
||||
use csv::{ReaderBuilder, Trim};
|
||||
use indexmap::IndexMap;
|
||||
use indicatif::{ProgressBar, ProgressStyle};
|
||||
use pickledb::PickleDb;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use solana_account_decoder::parse_token::{
|
||||
pubkey_from_spl_token, real_number_string, spl_token_pubkey,
|
||||
};
|
||||
use solana_client::{
|
||||
client_error::{ClientError, Result as ClientResult},
|
||||
rpc_client::RpcClient,
|
||||
rpc_config::RpcSendTransactionConfig,
|
||||
rpc_request::MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS,
|
||||
};
|
||||
use solana_sdk::{
|
||||
clock::Slot,
|
||||
commitment_config::CommitmentConfig,
|
||||
instruction::Instruction,
|
||||
message::Message,
|
||||
native_token::{lamports_to_sol, sol_to_lamports},
|
||||
signature::{unique_signers, Signature, Signer},
|
||||
stake::{
|
||||
instruction::{self as stake_instruction, LockupArgs},
|
||||
state::{Authorized, Lockup, StakeAuthorize},
|
||||
use {
|
||||
crate::{
|
||||
args::{
|
||||
BalancesArgs, DistributeTokensArgs, SenderStakeArgs, StakeArgs, TransactionLogArgs,
|
||||
},
|
||||
db::{self, TransactionInfo},
|
||||
spl_token::*,
|
||||
token_display::Token,
|
||||
},
|
||||
system_instruction,
|
||||
transaction::Transaction,
|
||||
};
|
||||
use solana_transaction_status::TransactionStatus;
|
||||
use spl_associated_token_account::get_associated_token_address;
|
||||
use spl_token::solana_program::program_error::ProgramError;
|
||||
use std::{
|
||||
cmp::{self},
|
||||
io,
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
chrono::prelude::*,
|
||||
console::style,
|
||||
csv::{ReaderBuilder, Trim},
|
||||
indexmap::IndexMap,
|
||||
indicatif::{ProgressBar, ProgressStyle},
|
||||
pickledb::PickleDb,
|
||||
serde::{Deserialize, Serialize},
|
||||
solana_account_decoder::parse_token::{
|
||||
pubkey_from_spl_token, real_number_string, spl_token_pubkey,
|
||||
},
|
||||
solana_client::{
|
||||
client_error::{ClientError, Result as ClientResult},
|
||||
rpc_client::RpcClient,
|
||||
rpc_config::RpcSendTransactionConfig,
|
||||
rpc_request::MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS,
|
||||
},
|
||||
solana_sdk::{
|
||||
clock::Slot,
|
||||
commitment_config::CommitmentConfig,
|
||||
instruction::Instruction,
|
||||
message::Message,
|
||||
native_token::{lamports_to_sol, sol_to_lamports},
|
||||
signature::{unique_signers, Signature, Signer},
|
||||
stake::{
|
||||
instruction::{self as stake_instruction, LockupArgs},
|
||||
state::{Authorized, Lockup, StakeAuthorize},
|
||||
},
|
||||
system_instruction,
|
||||
transaction::Transaction,
|
||||
},
|
||||
solana_transaction_status::TransactionStatus,
|
||||
spl_associated_token_account::get_associated_token_address,
|
||||
spl_token::solana_program::program_error::ProgramError,
|
||||
std::{
|
||||
cmp::{self},
|
||||
io,
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
},
|
||||
thread::sleep,
|
||||
time::Duration,
|
||||
},
|
||||
thread::sleep,
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
|
||||
@ -860,9 +864,11 @@ pub fn process_transaction_log(args: &TransactionLogArgs) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
use crate::db::check_output_file;
|
||||
use solana_sdk::{pubkey::Pubkey, signature::Keypair};
|
||||
use tempfile::{tempdir, NamedTempFile};
|
||||
use {
|
||||
crate::db::check_output_file,
|
||||
solana_sdk::{pubkey::Pubkey, signature::Keypair},
|
||||
tempfile::{tempdir, NamedTempFile},
|
||||
};
|
||||
pub fn test_process_distribute_tokens_with_client(
|
||||
client: &RpcClient,
|
||||
sender_keypair: Keypair,
|
||||
@ -1202,15 +1208,17 @@ pub fn test_process_distribute_stake_with_client(client: &RpcClient, sender_keyp
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use solana_sdk::{
|
||||
instruction::AccountMeta,
|
||||
signature::{read_keypair_file, write_keypair_file, Signer},
|
||||
stake::instruction::StakeInstruction,
|
||||
use {
|
||||
super::*,
|
||||
solana_sdk::{
|
||||
instruction::AccountMeta,
|
||||
signature::{read_keypair_file, write_keypair_file, Signer},
|
||||
stake::instruction::StakeInstruction,
|
||||
},
|
||||
solana_streamer::socket::SocketAddrSpace,
|
||||
solana_test_validator::TestValidator,
|
||||
solana_transaction_status::TransactionConfirmationStatus,
|
||||
};
|
||||
use solana_streamer::socket::SocketAddrSpace;
|
||||
use solana_test_validator::TestValidator;
|
||||
use solana_transaction_status::TransactionConfirmationStatus;
|
||||
|
||||
fn one_signer_message(client: &RpcClient) -> Message {
|
||||
Message::new_with_blockhash(
|
||||
|
@ -1,9 +1,11 @@
|
||||
use chrono::prelude::*;
|
||||
use pickledb::{error::Error, PickleDb, PickleDbDumpPolicy};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature, transaction::Transaction};
|
||||
use solana_transaction_status::TransactionStatus;
|
||||
use std::{cmp::Ordering, fs, io, path::Path};
|
||||
use {
|
||||
chrono::prelude::*,
|
||||
pickledb::{error::Error, PickleDb, PickleDbDumpPolicy},
|
||||
serde::{Deserialize, Serialize},
|
||||
solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature, transaction::Transaction},
|
||||
solana_transaction_status::TransactionStatus,
|
||||
std::{cmp::Ordering, fs, io, path::Path},
|
||||
};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
|
||||
pub struct TransactionInfo {
|
||||
@ -204,11 +206,13 @@ pub(crate) fn check_output_file(path: &str, db: &PickleDb) {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use csv::{ReaderBuilder, Trim};
|
||||
use solana_sdk::transaction::TransactionError;
|
||||
use solana_transaction_status::TransactionConfirmationStatus;
|
||||
use tempfile::NamedTempFile;
|
||||
use {
|
||||
super::*,
|
||||
csv::{ReaderBuilder, Trim},
|
||||
solana_sdk::transaction::TransactionError,
|
||||
solana_transaction_status::TransactionConfirmationStatus,
|
||||
tempfile::NamedTempFile,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn test_sort_transaction_infos_finalized_first() {
|
||||
|
@ -1,14 +1,16 @@
|
||||
use solana_cli_config::{Config, CONFIG_FILE};
|
||||
use solana_client::rpc_client::RpcClient;
|
||||
use solana_tokens::{arg_parser::parse_args, args::Command, commands, spl_token};
|
||||
use std::{
|
||||
env,
|
||||
error::Error,
|
||||
path::Path,
|
||||
process,
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
use {
|
||||
solana_cli_config::{Config, CONFIG_FILE},
|
||||
solana_client::rpc_client::RpcClient,
|
||||
solana_tokens::{arg_parser::parse_args, args::Command, commands, spl_token},
|
||||
std::{
|
||||
env,
|
||||
error::Error,
|
||||
path::Path,
|
||||
process,
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -1,18 +1,20 @@
|
||||
use crate::{
|
||||
args::{DistributeTokensArgs, SplTokenArgs},
|
||||
commands::{Allocation, Error, FundingSource},
|
||||
};
|
||||
use console::style;
|
||||
use solana_account_decoder::parse_token::{
|
||||
pubkey_from_spl_token, real_number_string, real_number_string_trimmed, spl_token_pubkey,
|
||||
};
|
||||
use solana_client::rpc_client::RpcClient;
|
||||
use solana_sdk::{instruction::Instruction, message::Message, native_token::lamports_to_sol};
|
||||
use solana_transaction_status::parse_token::spl_token_instruction;
|
||||
use spl_associated_token_account::{create_associated_token_account, get_associated_token_address};
|
||||
use spl_token::{
|
||||
solana_program::program_pack::Pack,
|
||||
state::{Account as SplTokenAccount, Mint},
|
||||
use {
|
||||
crate::{
|
||||
args::{DistributeTokensArgs, SplTokenArgs},
|
||||
commands::{Allocation, Error, FundingSource},
|
||||
},
|
||||
console::style,
|
||||
solana_account_decoder::parse_token::{
|
||||
pubkey_from_spl_token, real_number_string, real_number_string_trimmed, spl_token_pubkey,
|
||||
},
|
||||
solana_client::rpc_client::RpcClient,
|
||||
solana_sdk::{instruction::Instruction, message::Message, native_token::lamports_to_sol},
|
||||
solana_transaction_status::parse_token::spl_token_instruction,
|
||||
spl_associated_token_account::{create_associated_token_account, get_associated_token_address},
|
||||
spl_token::{
|
||||
solana_program::program_pack::Pack,
|
||||
state::{Account as SplTokenAccount, Mint},
|
||||
},
|
||||
};
|
||||
|
||||
pub fn update_token_args(client: &RpcClient, args: &mut Option<SplTokenArgs>) -> Result<(), Error> {
|
||||
|
@ -1,8 +1,10 @@
|
||||
use solana_account_decoder::parse_token::real_number_string_trimmed;
|
||||
use solana_sdk::native_token::lamports_to_sol;
|
||||
use std::{
|
||||
fmt::{Debug, Display, Formatter, Result},
|
||||
ops::Add,
|
||||
use {
|
||||
solana_account_decoder::parse_token::real_number_string_trimmed,
|
||||
solana_sdk::native_token::lamports_to_sol,
|
||||
std::{
|
||||
fmt::{Debug, Display, Formatter, Result},
|
||||
ops::Add,
|
||||
},
|
||||
};
|
||||
|
||||
const SOL_SYMBOL: &str = "◎";
|
||||
|
Reference in New Issue
Block a user