Move CLI cli_output module to its own crate
This commit is contained in:
committed by
Trent Nelson
parent
ba353c2b1d
commit
325a7e9f86
26
Cargo.lock
generated
26
Cargo.lock
generated
@ -3548,6 +3548,7 @@ dependencies = [
|
|||||||
"solana-account-decoder",
|
"solana-account-decoder",
|
||||||
"solana-clap-utils",
|
"solana-clap-utils",
|
||||||
"solana-cli-config",
|
"solana-cli-config",
|
||||||
|
"solana-cli-output",
|
||||||
"solana-client",
|
"solana-client",
|
||||||
"solana-config-program",
|
"solana-config-program",
|
||||||
"solana-core",
|
"solana-core",
|
||||||
@ -3578,6 +3579,25 @@ dependencies = [
|
|||||||
"url 2.1.1",
|
"url 2.1.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "solana-cli-output"
|
||||||
|
version = "1.4.0"
|
||||||
|
dependencies = [
|
||||||
|
"Inflector",
|
||||||
|
"chrono",
|
||||||
|
"console",
|
||||||
|
"humantime 2.0.1",
|
||||||
|
"indicatif",
|
||||||
|
"serde",
|
||||||
|
"serde_derive",
|
||||||
|
"serde_json",
|
||||||
|
"solana-client",
|
||||||
|
"solana-sdk 1.4.0",
|
||||||
|
"solana-stake-program",
|
||||||
|
"solana-transaction-status",
|
||||||
|
"solana-vote-program",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "solana-client"
|
name = "solana-client"
|
||||||
version = "1.4.0"
|
version = "1.4.0"
|
||||||
@ -3986,7 +4006,7 @@ dependencies = [
|
|||||||
"serde_yaml",
|
"serde_yaml",
|
||||||
"signal-hook",
|
"signal-hook",
|
||||||
"solana-clap-utils",
|
"solana-clap-utils",
|
||||||
"solana-cli",
|
"solana-cli-output",
|
||||||
"solana-ledger",
|
"solana-ledger",
|
||||||
"solana-logger 1.4.0",
|
"solana-logger 1.4.0",
|
||||||
"solana-measure",
|
"solana-measure",
|
||||||
@ -4491,8 +4511,8 @@ dependencies = [
|
|||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"serde_yaml",
|
"serde_yaml",
|
||||||
"solana-clap-utils",
|
"solana-clap-utils",
|
||||||
"solana-cli",
|
|
||||||
"solana-cli-config",
|
"solana-cli-config",
|
||||||
|
"solana-cli-output",
|
||||||
"solana-client",
|
"solana-client",
|
||||||
"solana-logger 1.4.0",
|
"solana-logger 1.4.0",
|
||||||
"solana-metrics",
|
"solana-metrics",
|
||||||
@ -4736,8 +4756,8 @@ dependencies = [
|
|||||||
"humantime 2.0.1",
|
"humantime 2.0.1",
|
||||||
"log 0.4.8",
|
"log 0.4.8",
|
||||||
"solana-clap-utils",
|
"solana-clap-utils",
|
||||||
"solana-cli",
|
|
||||||
"solana-cli-config",
|
"solana-cli-config",
|
||||||
|
"solana-cli-output",
|
||||||
"solana-client",
|
"solana-client",
|
||||||
"solana-logger 1.4.0",
|
"solana-logger 1.4.0",
|
||||||
"solana-metrics",
|
"solana-metrics",
|
||||||
|
@ -10,6 +10,7 @@ members = [
|
|||||||
"banks-server",
|
"banks-server",
|
||||||
"clap-utils",
|
"clap-utils",
|
||||||
"cli-config",
|
"cli-config",
|
||||||
|
"cli-output",
|
||||||
"client",
|
"client",
|
||||||
"core",
|
"core",
|
||||||
"dos",
|
"dos",
|
||||||
|
27
cli-output/Cargo.toml
Normal file
27
cli-output/Cargo.toml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
[package]
|
||||||
|
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||||
|
edition = "2018"
|
||||||
|
name = "solana-cli-output"
|
||||||
|
description = "Blockchain, Rebuilt for Scale"
|
||||||
|
version = "1.4.0"
|
||||||
|
repository = "https://github.com/solana-labs/solana"
|
||||||
|
license = "Apache-2.0"
|
||||||
|
homepage = "https://solana.com/"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
chrono = { version = "0.4.11", features = ["serde"] }
|
||||||
|
console = "0.11.3"
|
||||||
|
humantime = "2.0.1"
|
||||||
|
Inflector = "0.11.4"
|
||||||
|
indicatif = "0.15.0"
|
||||||
|
serde = "1.0.112"
|
||||||
|
serde_derive = "1.0.103"
|
||||||
|
serde_json = "1.0.56"
|
||||||
|
solana-client = { path = "../client", version = "1.4.0" }
|
||||||
|
solana-sdk = { path = "../sdk", version = "1.4.0" }
|
||||||
|
solana-stake-program = { path = "../programs/stake", version = "1.4.0" }
|
||||||
|
solana-transaction-status = { path = "../transaction-status", version = "1.4.0" }
|
||||||
|
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
targets = ["x86_64-unknown-linux-gnu"]
|
@ -1,11 +1,8 @@
|
|||||||
use crate::{
|
use crate::display::{build_balance_message, format_labeled_address, writeln_name_value};
|
||||||
cli::build_balance_message,
|
|
||||||
display::{format_labeled_address, writeln_name_value},
|
|
||||||
};
|
|
||||||
use chrono::{DateTime, NaiveDateTime, SecondsFormat, Utc};
|
use chrono::{DateTime, NaiveDateTime, SecondsFormat, Utc};
|
||||||
use console::{style, Emoji};
|
use console::{style, Emoji};
|
||||||
use inflector::cases::titlecase::to_title_case;
|
use inflector::cases::titlecase::to_title_case;
|
||||||
use serde::Serialize;
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_json::{Map, Value};
|
use serde_json::{Map, Value};
|
||||||
use solana_client::rpc_response::{
|
use solana_client::rpc_response::{
|
||||||
RpcAccountBalance, RpcKeyedAccount, RpcSupply, RpcVoteAccountInfo,
|
RpcAccountBalance, RpcKeyedAccount, RpcSupply, RpcVoteAccountInfo,
|
@ -1,4 +1,3 @@
|
|||||||
use crate::cli::SettingType;
|
|
||||||
use console::style;
|
use console::style;
|
||||||
use indicatif::{ProgressBar, ProgressStyle};
|
use indicatif::{ProgressBar, ProgressStyle};
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
@ -8,6 +7,24 @@ use solana_sdk::{
|
|||||||
use solana_transaction_status::UiTransactionStatusMeta;
|
use solana_transaction_status::UiTransactionStatusMeta;
|
||||||
use std::{collections::HashMap, fmt, io};
|
use std::{collections::HashMap, fmt, io};
|
||||||
|
|
||||||
|
pub fn build_balance_message(lamports: u64, use_lamports_unit: bool, show_unit: bool) -> String {
|
||||||
|
if use_lamports_unit {
|
||||||
|
let ess = if lamports == 1 { "" } else { "s" };
|
||||||
|
let unit = if show_unit {
|
||||||
|
format!(" lamport{}", ess)
|
||||||
|
} else {
|
||||||
|
"".to_string()
|
||||||
|
};
|
||||||
|
format!("{:?}{}", lamports, unit)
|
||||||
|
} else {
|
||||||
|
let sol = lamports_to_sol(lamports);
|
||||||
|
let sol_str = format!("{:.9}", sol);
|
||||||
|
let pretty_sol = sol_str.trim_end_matches('0').trim_end_matches('.');
|
||||||
|
let unit = if show_unit { " SOL" } else { "" };
|
||||||
|
format!("{}{}", pretty_sol, unit)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Pretty print a "name value"
|
// Pretty print a "name value"
|
||||||
pub fn println_name_value(name: &str, value: &str) {
|
pub fn println_name_value(name: &str, value: &str) {
|
||||||
let styled_value = if value == "" {
|
let styled_value = if value == "" {
|
||||||
@ -40,21 +57,6 @@ pub fn format_labeled_address(pubkey: &str, address_labels: &HashMap<String, Str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn println_name_value_or(name: &str, value: &str, setting_type: SettingType) {
|
|
||||||
let description = match setting_type {
|
|
||||||
SettingType::Explicit => "",
|
|
||||||
SettingType::Computed => "(computed)",
|
|
||||||
SettingType::SystemDefault => "(default)",
|
|
||||||
};
|
|
||||||
|
|
||||||
println!(
|
|
||||||
"{} {} {}",
|
|
||||||
style(name).bold(),
|
|
||||||
style(value),
|
|
||||||
style(description).italic(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn println_signers(
|
pub fn println_signers(
|
||||||
blockhash: &Hash,
|
blockhash: &Hash,
|
||||||
signers: &[String],
|
signers: &[String],
|
3
cli-output/src/lib.rs
Normal file
3
cli-output/src/lib.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
mod cli_output;
|
||||||
|
pub mod display;
|
||||||
|
pub use cli_output::*;
|
@ -30,6 +30,7 @@ serde_json = "1.0.56"
|
|||||||
solana-account-decoder = { path = "../account-decoder", version = "1.4.0" }
|
solana-account-decoder = { path = "../account-decoder", version = "1.4.0" }
|
||||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||||
solana-cli-config = { path = "../cli-config", version = "1.4.0" }
|
solana-cli-config = { path = "../cli-config", version = "1.4.0" }
|
||||||
|
solana-cli-output = { path = "../cli-output", version = "1.4.0" }
|
||||||
solana-client = { path = "../client", version = "1.4.0" }
|
solana-client = { path = "../client", version = "1.4.0" }
|
||||||
solana-config-program = { path = "../programs/config", version = "1.4.0" }
|
solana-config-program = { path = "../programs/config", version = "1.4.0" }
|
||||||
solana-faucet = { path = "../faucet", version = "1.4.0" }
|
solana-faucet = { path = "../faucet", version = "1.4.0" }
|
||||||
|
@ -1,14 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
checks::*,
|
checks::*, cluster_query::*, nonce::*, offline::return_signers, spend_utils::*, stake::*,
|
||||||
cli_output::{CliAccount, CliSignature, OutputFormat},
|
validator_info::*, vote::*,
|
||||||
cluster_query::*,
|
|
||||||
display::{new_spinner_progress_bar, println_name_value, println_transaction},
|
|
||||||
nonce::*,
|
|
||||||
offline::return_signers,
|
|
||||||
spend_utils::*,
|
|
||||||
stake::*,
|
|
||||||
validator_info::*,
|
|
||||||
vote::*,
|
|
||||||
};
|
};
|
||||||
use clap::{value_t_or_exit, App, AppSettings, Arg, ArgMatches, SubCommand};
|
use clap::{value_t_or_exit, App, AppSettings, Arg, ArgMatches, SubCommand};
|
||||||
use log::*;
|
use log::*;
|
||||||
@ -25,6 +17,12 @@ use solana_clap_utils::{
|
|||||||
nonce::*,
|
nonce::*,
|
||||||
offline::*,
|
offline::*,
|
||||||
};
|
};
|
||||||
|
use solana_cli_output::{
|
||||||
|
display::{
|
||||||
|
build_balance_message, new_spinner_progress_bar, println_name_value, println_transaction,
|
||||||
|
},
|
||||||
|
CliAccount, CliSignature, OutputFormat,
|
||||||
|
};
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
blockhash_query::BlockhashQuery,
|
blockhash_query::BlockhashQuery,
|
||||||
client_error::{ClientError, ClientErrorKind, Result as ClientResult},
|
client_error::{ClientError, ClientErrorKind, Result as ClientResult},
|
||||||
@ -47,7 +45,6 @@ use solana_sdk::{
|
|||||||
instruction::InstructionError,
|
instruction::InstructionError,
|
||||||
loader_instruction,
|
loader_instruction,
|
||||||
message::Message,
|
message::Message,
|
||||||
native_token::lamports_to_sol,
|
|
||||||
pubkey::{Pubkey, MAX_SEED_LEN},
|
pubkey::{Pubkey, MAX_SEED_LEN},
|
||||||
signature::{Keypair, Signature, Signer, SignerError},
|
signature::{Keypair, Signature, Signer, SignerError},
|
||||||
signers::Signers,
|
signers::Signers,
|
||||||
@ -1940,28 +1937,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn build_balance_message(
|
|
||||||
lamports: u64,
|
|
||||||
use_lamports_unit: bool,
|
|
||||||
show_unit: bool,
|
|
||||||
) -> String {
|
|
||||||
if use_lamports_unit {
|
|
||||||
let ess = if lamports == 1 { "" } else { "s" };
|
|
||||||
let unit = if show_unit {
|
|
||||||
format!(" lamport{}", ess)
|
|
||||||
} else {
|
|
||||||
"".to_string()
|
|
||||||
};
|
|
||||||
format!("{:?}{}", lamports, unit)
|
|
||||||
} else {
|
|
||||||
let sol = lamports_to_sol(lamports);
|
|
||||||
let sol_str = format!("{:.9}", sol);
|
|
||||||
let pretty_sol = sol_str.trim_end_matches('0').trim_end_matches('.');
|
|
||||||
let unit = if show_unit { " SOL" } else { "" };
|
|
||||||
format!("{}{}", pretty_sol, unit)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, 'v> {
|
pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, 'v> {
|
||||||
App::new(name)
|
App::new(name)
|
||||||
.about(about)
|
.about(about)
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult},
|
cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult},
|
||||||
cli_output::*,
|
|
||||||
display::{
|
|
||||||
format_labeled_address, new_spinner_progress_bar, println_name_value, println_transaction,
|
|
||||||
},
|
|
||||||
spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount},
|
spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount},
|
||||||
};
|
};
|
||||||
use clap::{value_t, value_t_or_exit, App, AppSettings, Arg, ArgMatches, SubCommand};
|
use clap::{value_t, value_t_or_exit, App, AppSettings, Arg, ArgMatches, SubCommand};
|
||||||
@ -11,6 +7,12 @@ use console::{style, Emoji};
|
|||||||
use solana_clap_utils::{
|
use solana_clap_utils::{
|
||||||
commitment::commitment_arg, input_parsers::*, input_validators::*, keypair::DefaultSigner,
|
commitment::commitment_arg, input_parsers::*, input_validators::*, keypair::DefaultSigner,
|
||||||
};
|
};
|
||||||
|
use solana_cli_output::{
|
||||||
|
display::{
|
||||||
|
format_labeled_address, new_spinner_progress_bar, println_name_value, println_transaction,
|
||||||
|
},
|
||||||
|
*,
|
||||||
|
};
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
pubsub_client::PubsubClient,
|
pubsub_client::PubsubClient,
|
||||||
rpc_client::{GetConfirmedSignaturesForAddress2Config, RpcClient},
|
rpc_client::{GetConfirmedSignaturesForAddress2Config, RpcClient},
|
||||||
|
@ -18,14 +18,11 @@ macro_rules! pubkey {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|
||||||
pub mod checks;
|
pub mod checks;
|
||||||
pub mod cli;
|
pub mod cli;
|
||||||
pub mod cli_output;
|
|
||||||
pub mod cluster_query;
|
pub mod cluster_query;
|
||||||
pub mod display;
|
|
||||||
pub mod nonce;
|
pub mod nonce;
|
||||||
pub mod offline;
|
pub mod offline;
|
||||||
pub mod spend_utils;
|
pub mod spend_utils;
|
||||||
|
@ -11,18 +11,31 @@ use solana_clap_utils::{
|
|||||||
keypair::{CliSigners, DefaultSigner, SKIP_SEED_PHRASE_VALIDATION_ARG},
|
keypair::{CliSigners, DefaultSigner, SKIP_SEED_PHRASE_VALIDATION_ARG},
|
||||||
DisplayError,
|
DisplayError,
|
||||||
};
|
};
|
||||||
use solana_cli::{
|
use solana_cli::cli::{
|
||||||
cli::{
|
app, parse_command, process_command, CliCommandInfo, CliConfig, SettingType,
|
||||||
app, parse_command, process_command, CliCommandInfo, CliConfig, DEFAULT_RPC_TIMEOUT_SECONDS,
|
DEFAULT_RPC_TIMEOUT_SECONDS,
|
||||||
},
|
|
||||||
cli_output::OutputFormat,
|
|
||||||
display::{println_name_value, println_name_value_or},
|
|
||||||
};
|
};
|
||||||
use solana_cli_config::{Config, CONFIG_FILE};
|
use solana_cli_config::{Config, CONFIG_FILE};
|
||||||
|
use solana_cli_output::{display::println_name_value, OutputFormat};
|
||||||
use solana_client::rpc_config::RpcSendTransactionConfig;
|
use solana_client::rpc_config::RpcSendTransactionConfig;
|
||||||
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
||||||
use std::{collections::HashMap, error, path::PathBuf, sync::Arc, time::Duration};
|
use std::{collections::HashMap, error, path::PathBuf, sync::Arc, time::Duration};
|
||||||
|
|
||||||
|
pub fn println_name_value_or(name: &str, value: &str, setting_type: SettingType) {
|
||||||
|
let description = match setting_type {
|
||||||
|
SettingType::Explicit => "",
|
||||||
|
SettingType::Computed => "(computed)",
|
||||||
|
SettingType::SystemDefault => "(default)",
|
||||||
|
};
|
||||||
|
|
||||||
|
println!(
|
||||||
|
"{} {} {}",
|
||||||
|
style(name).bold(),
|
||||||
|
style(value),
|
||||||
|
style(description).italic(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
fn parse_settings(matches: &ArgMatches<'_>) -> Result<bool, Box<dyn error::Error>> {
|
fn parse_settings(matches: &ArgMatches<'_>) -> Result<bool, Box<dyn error::Error>> {
|
||||||
let parse_args = match matches.subcommand() {
|
let parse_args = match matches.subcommand() {
|
||||||
("config", Some(matches)) => {
|
("config", Some(matches)) => {
|
||||||
|
@ -4,7 +4,6 @@ use crate::{
|
|||||||
log_instruction_custom_error, CliCommand, CliCommandInfo, CliConfig, CliError,
|
log_instruction_custom_error, CliCommand, CliCommandInfo, CliConfig, CliError,
|
||||||
ProcessResult,
|
ProcessResult,
|
||||||
},
|
},
|
||||||
cli_output::CliNonceAccount,
|
|
||||||
spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount},
|
spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount},
|
||||||
};
|
};
|
||||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||||
@ -14,6 +13,7 @@ use solana_clap_utils::{
|
|||||||
keypair::{DefaultSigner, SignerIndex},
|
keypair::{DefaultSigner, SignerIndex},
|
||||||
nonce::*,
|
nonce::*,
|
||||||
};
|
};
|
||||||
|
use solana_cli_output::CliNonceAccount;
|
||||||
use solana_client::{nonce_utils::*, rpc_client::RpcClient};
|
use solana_client::{nonce_utils::*, rpc_client::RpcClient};
|
||||||
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use crate::cli_output::{CliSignOnlyData, OutputFormat};
|
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use solana_clap_utils::keypair::presigner_from_pubkey_sigs;
|
use solana_clap_utils::keypair::presigner_from_pubkey_sigs;
|
||||||
|
use solana_cli_output::{CliSignOnlyData, OutputFormat};
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
hash::Hash,
|
hash::Hash,
|
||||||
pubkey::Pubkey,
|
pubkey::Pubkey,
|
||||||
|
@ -4,7 +4,6 @@ use crate::{
|
|||||||
log_instruction_custom_error, CliCommand, CliCommandInfo, CliConfig, CliError,
|
log_instruction_custom_error, CliCommand, CliCommandInfo, CliConfig, CliError,
|
||||||
ProcessResult,
|
ProcessResult,
|
||||||
},
|
},
|
||||||
cli_output::{CliStakeHistory, CliStakeHistoryEntry, CliStakeState, CliStakeType},
|
|
||||||
nonce::check_nonce_account,
|
nonce::check_nonce_account,
|
||||||
offline::return_signers,
|
offline::return_signers,
|
||||||
spend_utils::{resolve_spend_tx_and_check_account_balances, SpendAmount},
|
spend_utils::{resolve_spend_tx_and_check_account_balances, SpendAmount},
|
||||||
@ -19,6 +18,7 @@ use solana_clap_utils::{
|
|||||||
offline::*,
|
offline::*,
|
||||||
ArgConstant,
|
ArgConstant,
|
||||||
};
|
};
|
||||||
|
use solana_cli_output::{CliStakeHistory, CliStakeHistoryEntry, CliStakeState, CliStakeType};
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
blockhash_query::BlockhashQuery, nonce_utils, rpc_client::RpcClient,
|
blockhash_query::BlockhashQuery, nonce_utils, rpc_client::RpcClient,
|
||||||
rpc_request::DELINQUENT_VALIDATOR_SLOT_DISTANCE,
|
rpc_request::DELINQUENT_VALIDATOR_SLOT_DISTANCE,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult},
|
cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult},
|
||||||
cli_output::{CliValidatorInfo, CliValidatorInfoVec},
|
|
||||||
spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount},
|
spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount},
|
||||||
};
|
};
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
@ -15,6 +14,7 @@ use solana_clap_utils::{
|
|||||||
input_validators::{is_pubkey, is_url},
|
input_validators::{is_pubkey, is_url},
|
||||||
keypair::DefaultSigner,
|
keypair::DefaultSigner,
|
||||||
};
|
};
|
||||||
|
use solana_cli_output::{CliValidatorInfo, CliValidatorInfoVec};
|
||||||
use solana_client::rpc_client::RpcClient;
|
use solana_client::rpc_client::RpcClient;
|
||||||
use solana_config_program::{config_instruction, get_config_data, ConfigKeys, ConfigState};
|
use solana_config_program::{config_instruction, get_config_data, ConfigKeys, ConfigState};
|
||||||
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
||||||
|
@ -4,7 +4,6 @@ use crate::{
|
|||||||
log_instruction_custom_error, CliCommand, CliCommandInfo, CliConfig, CliError,
|
log_instruction_custom_error, CliCommand, CliCommandInfo, CliConfig, CliError,
|
||||||
ProcessResult,
|
ProcessResult,
|
||||||
},
|
},
|
||||||
cli_output::{CliEpochVotingHistory, CliLockout, CliVoteAccount},
|
|
||||||
spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount},
|
spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount},
|
||||||
};
|
};
|
||||||
use clap::{value_t_or_exit, App, Arg, ArgMatches, SubCommand};
|
use clap::{value_t_or_exit, App, Arg, ArgMatches, SubCommand};
|
||||||
@ -14,6 +13,7 @@ use solana_clap_utils::{
|
|||||||
input_validators::*,
|
input_validators::*,
|
||||||
keypair::{DefaultSigner, SignerIndex},
|
keypair::{DefaultSigner, SignerIndex},
|
||||||
};
|
};
|
||||||
|
use solana_cli_output::{CliEpochVotingHistory, CliLockout, CliVoteAccount};
|
||||||
use solana_client::rpc_client::RpcClient;
|
use solana_client::rpc_client::RpcClient;
|
||||||
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
use solana_cli::{
|
use solana_cli::{
|
||||||
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
|
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
|
||||||
cli_output::OutputFormat,
|
|
||||||
offline::parse_sign_only_reply_string,
|
offline::parse_sign_only_reply_string,
|
||||||
spend_utils::SpendAmount,
|
spend_utils::SpendAmount,
|
||||||
test_utils::{check_ready, check_recent_balance},
|
test_utils::{check_ready, check_recent_balance},
|
||||||
};
|
};
|
||||||
|
use solana_cli_output::OutputFormat;
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
blockhash_query::{self, BlockhashQuery},
|
blockhash_query::{self, BlockhashQuery},
|
||||||
nonce_utils,
|
nonce_utils,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
use solana_cli::{
|
use solana_cli::{
|
||||||
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
|
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
|
||||||
cli_output::OutputFormat,
|
|
||||||
offline::parse_sign_only_reply_string,
|
offline::parse_sign_only_reply_string,
|
||||||
spend_utils::SpendAmount,
|
spend_utils::SpendAmount,
|
||||||
test_utils::{check_ready, check_recent_balance},
|
test_utils::{check_ready, check_recent_balance},
|
||||||
};
|
};
|
||||||
|
use solana_cli_output::OutputFormat;
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
blockhash_query::{self, BlockhashQuery},
|
blockhash_query::{self, BlockhashQuery},
|
||||||
nonce_utils,
|
nonce_utils,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
use solana_cli::{
|
use solana_cli::{
|
||||||
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
|
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
|
||||||
cli_output::OutputFormat,
|
|
||||||
offline::parse_sign_only_reply_string,
|
offline::parse_sign_only_reply_string,
|
||||||
spend_utils::SpendAmount,
|
spend_utils::SpendAmount,
|
||||||
test_utils::{check_ready, check_recent_balance},
|
test_utils::{check_ready, check_recent_balance},
|
||||||
};
|
};
|
||||||
|
use solana_cli_output::OutputFormat;
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
blockhash_query::{self, BlockhashQuery},
|
blockhash_query::{self, BlockhashQuery},
|
||||||
nonce_utils,
|
nonce_utils,
|
||||||
|
@ -20,7 +20,7 @@ regex = "1"
|
|||||||
serde_json = "1.0.56"
|
serde_json = "1.0.56"
|
||||||
serde_yaml = "0.8.13"
|
serde_yaml = "0.8.13"
|
||||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||||
solana-cli = { path = "../cli", version = "1.4.0" }
|
solana-cli-output = { path = "../cli-output", version = "1.4.0" }
|
||||||
solana-ledger = { path = "../ledger", version = "1.4.0" }
|
solana-ledger = { path = "../ledger", version = "1.4.0" }
|
||||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||||
solana-measure = { path = "../measure", version = "1.4.0" }
|
solana-measure = { path = "../measure", version = "1.4.0" }
|
||||||
|
@ -4,7 +4,7 @@ use solana_clap_utils::{
|
|||||||
input_parsers::pubkey_of,
|
input_parsers::pubkey_of,
|
||||||
input_validators::{is_slot, is_valid_pubkey},
|
input_validators::{is_slot, is_valid_pubkey},
|
||||||
};
|
};
|
||||||
use solana_cli::display::println_transaction;
|
use solana_cli_output::display::println_transaction;
|
||||||
use solana_ledger::{blockstore::Blockstore, blockstore_db::AccessType};
|
use solana_ledger::{blockstore::Blockstore, blockstore_db::AccessType};
|
||||||
use solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature};
|
use solana_sdk::{clock::Slot, pubkey::Pubkey, signature::Signature};
|
||||||
use solana_transaction_status::UiTransactionEncoding;
|
use solana_transaction_status::UiTransactionEncoding;
|
||||||
|
@ -118,7 +118,7 @@ fn output_entry(
|
|||||||
})
|
})
|
||||||
.map(|transaction_status| transaction_status.into());
|
.map(|transaction_status| transaction_status.into());
|
||||||
|
|
||||||
solana_cli::display::println_transaction(
|
solana_cli_output::display::println_transaction(
|
||||||
&transaction,
|
&transaction,
|
||||||
&transaction_status,
|
&transaction_status,
|
||||||
" ",
|
" ",
|
||||||
|
@ -15,7 +15,7 @@ serde_yaml = "0.8.13"
|
|||||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||||
solana-client = { path = "../client", version = "1.4.0" }
|
solana-client = { path = "../client", version = "1.4.0" }
|
||||||
solana-cli-config = { path = "../cli-config", version = "1.4.0" }
|
solana-cli-config = { path = "../cli-config", version = "1.4.0" }
|
||||||
solana-cli = { path = "../cli", version = "1.4.0" }
|
solana-cli-output = { path = "../cli-output", version = "1.4.0" }
|
||||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||||
solana-notifier = { path = "../notifier", version = "1.4.0" }
|
solana-notifier = { path = "../notifier", version = "1.4.0" }
|
||||||
|
@ -4,7 +4,7 @@ use solana_clap_utils::{
|
|||||||
input_parsers::{keypair_of, pubkey_of},
|
input_parsers::{keypair_of, pubkey_of},
|
||||||
input_validators::{is_amount, is_keypair, is_pubkey_or_keypair, is_url, is_valid_percentage},
|
input_validators::{is_amount, is_keypair, is_pubkey_or_keypair, is_url, is_valid_percentage},
|
||||||
};
|
};
|
||||||
use solana_cli::display::format_labeled_address;
|
use solana_cli_output::display::format_labeled_address;
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
client_error, rpc_client::RpcClient, rpc_request::MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS,
|
client_error, rpc_client::RpcClient, rpc_request::MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS,
|
||||||
rpc_response::RpcVoteAccountInfo,
|
rpc_response::RpcVoteAccountInfo,
|
||||||
|
@ -14,7 +14,7 @@ log = "0.4.8"
|
|||||||
humantime = "2.0.1"
|
humantime = "2.0.1"
|
||||||
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
solana-clap-utils = { path = "../clap-utils", version = "1.4.0" }
|
||||||
solana-cli-config = { path = "../cli-config", version = "1.4.0" }
|
solana-cli-config = { path = "../cli-config", version = "1.4.0" }
|
||||||
solana-cli = { path = "../cli", version = "1.4.0" }
|
solana-cli-output = { path = "../cli-output", version = "1.4.0" }
|
||||||
solana-client = { path = "../client", version = "1.4.0" }
|
solana-client = { path = "../client", version = "1.4.0" }
|
||||||
solana-logger = { path = "../logger", version = "1.4.0" }
|
solana-logger = { path = "../logger", version = "1.4.0" }
|
||||||
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
solana-metrics = { path = "../metrics", version = "1.4.0" }
|
||||||
|
@ -6,7 +6,7 @@ use solana_clap_utils::{
|
|||||||
input_parsers::pubkeys_of,
|
input_parsers::pubkeys_of,
|
||||||
input_validators::{is_pubkey_or_keypair, is_url},
|
input_validators::{is_pubkey_or_keypair, is_url},
|
||||||
};
|
};
|
||||||
use solana_cli::display::{format_labeled_address, write_transaction};
|
use solana_cli_output::display::{format_labeled_address, write_transaction};
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
client_error::Result as ClientResult, rpc_client::RpcClient, rpc_response::RpcVoteAccountStatus,
|
client_error::Result as ClientResult, rpc_client::RpcClient, rpc_response::RpcVoteAccountStatus,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user