Move CLI blockhash_query module into client crate
This commit is contained in:
committed by
Trent Nelson
parent
0c58123b45
commit
ba353c2b1d
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -3585,6 +3585,7 @@ dependencies = [
|
|||||||
"assert_matches",
|
"assert_matches",
|
||||||
"bincode",
|
"bincode",
|
||||||
"bs58",
|
"bs58",
|
||||||
|
"clap",
|
||||||
"indicatif",
|
"indicatif",
|
||||||
"jsonrpc-core",
|
"jsonrpc-core",
|
||||||
"jsonrpc-http-server",
|
"jsonrpc-http-server",
|
||||||
|
@ -4,7 +4,7 @@ use crate::{
|
|||||||
cluster_query::*,
|
cluster_query::*,
|
||||||
display::{new_spinner_progress_bar, println_name_value, println_transaction},
|
display::{new_spinner_progress_bar, println_name_value, println_transaction},
|
||||||
nonce::*,
|
nonce::*,
|
||||||
offline::{blockhash_query::BlockhashQuery, return_signers},
|
offline::return_signers,
|
||||||
spend_utils::*,
|
spend_utils::*,
|
||||||
stake::*,
|
stake::*,
|
||||||
validator_info::*,
|
validator_info::*,
|
||||||
@ -26,6 +26,7 @@ use solana_clap_utils::{
|
|||||||
offline::*,
|
offline::*,
|
||||||
};
|
};
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
|
blockhash_query::BlockhashQuery,
|
||||||
client_error::{ClientError, ClientErrorKind, Result as ClientResult},
|
client_error::{ClientError, ClientErrorKind, Result as ClientResult},
|
||||||
nonce_utils,
|
nonce_utils,
|
||||||
rpc_client::RpcClient,
|
rpc_client::RpcClient,
|
||||||
@ -2224,9 +2225,8 @@ pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, '
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::offline::*;
|
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use solana_client::mock_sender::SIGNATURE;
|
use solana_client::{blockhash_query, mock_sender::SIGNATURE};
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
pubkey::Pubkey,
|
pubkey::Pubkey,
|
||||||
signature::{keypair_from_seed, read_keypair_file, write_keypair_file, Presigner},
|
signature::{keypair_from_seed, read_keypair_file, write_keypair_file, Presigner},
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
pub mod blockhash_query;
|
|
||||||
|
|
||||||
use crate::cli_output::{CliSignOnlyData, OutputFormat};
|
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_client::rpc_client::RpcClient;
|
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
fee_calculator::FeeCalculator,
|
|
||||||
hash::Hash,
|
hash::Hash,
|
||||||
pubkey::Pubkey,
|
pubkey::Pubkey,
|
||||||
signature::{Presigner, Signature},
|
signature::{Presigner, Signature},
|
||||||
|
@ -6,7 +6,7 @@ use crate::{
|
|||||||
},
|
},
|
||||||
cli_output::{CliStakeHistory, CliStakeHistoryEntry, CliStakeState, CliStakeType},
|
cli_output::{CliStakeHistory, CliStakeHistoryEntry, CliStakeState, CliStakeType},
|
||||||
nonce::check_nonce_account,
|
nonce::check_nonce_account,
|
||||||
offline::{blockhash_query::BlockhashQuery, 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},
|
||||||
};
|
};
|
||||||
use clap::{App, Arg, ArgGroup, ArgMatches, SubCommand};
|
use clap::{App, Arg, ArgGroup, ArgMatches, SubCommand};
|
||||||
@ -20,7 +20,8 @@ use solana_clap_utils::{
|
|||||||
ArgConstant,
|
ArgConstant,
|
||||||
};
|
};
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
nonce_utils, rpc_client::RpcClient, rpc_request::DELINQUENT_VALIDATOR_SLOT_DISTANCE,
|
blockhash_query::BlockhashQuery, nonce_utils, rpc_client::RpcClient,
|
||||||
|
rpc_request::DELINQUENT_VALIDATOR_SLOT_DISTANCE,
|
||||||
};
|
};
|
||||||
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
@ -1770,10 +1771,8 @@ pub fn process_delegate_stake(
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::cli::{app, parse_command};
|
||||||
cli::{app, parse_command},
|
use solana_client::blockhash_query;
|
||||||
offline::blockhash_query,
|
|
||||||
};
|
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
hash::Hash,
|
hash::Hash,
|
||||||
signature::{
|
signature::{
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
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,
|
cli_output::OutputFormat,
|
||||||
offline::{
|
offline::parse_sign_only_reply_string,
|
||||||
blockhash_query::{self, BlockhashQuery},
|
|
||||||
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_client::{nonce_utils, rpc_client::RpcClient};
|
use solana_client::{
|
||||||
|
blockhash_query::{self, BlockhashQuery},
|
||||||
|
nonce_utils,
|
||||||
|
rpc_client::RpcClient,
|
||||||
|
};
|
||||||
use solana_core::contact_info::ContactInfo;
|
use solana_core::contact_info::ContactInfo;
|
||||||
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
|
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
|
||||||
use solana_faucet::faucet::run_local_faucet;
|
use solana_faucet::faucet::run_local_faucet;
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
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,
|
cli_output::OutputFormat,
|
||||||
offline::{
|
offline::parse_sign_only_reply_string,
|
||||||
blockhash_query::{self, BlockhashQuery},
|
|
||||||
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_client::{nonce_utils, rpc_client::RpcClient};
|
use solana_client::{
|
||||||
|
blockhash_query::{self, BlockhashQuery},
|
||||||
|
nonce_utils,
|
||||||
|
rpc_client::RpcClient,
|
||||||
|
};
|
||||||
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
|
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
|
||||||
use solana_faucet::faucet::run_local_faucet;
|
use solana_faucet::faucet::run_local_faucet;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
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,
|
cli_output::OutputFormat,
|
||||||
offline::{
|
offline::parse_sign_only_reply_string,
|
||||||
blockhash_query::{self, BlockhashQuery},
|
|
||||||
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_client::{nonce_utils, rpc_client::RpcClient};
|
use solana_client::{
|
||||||
|
blockhash_query::{self, BlockhashQuery},
|
||||||
|
nonce_utils,
|
||||||
|
rpc_client::RpcClient,
|
||||||
|
};
|
||||||
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
|
use solana_core::test_validator::{TestValidator, TestValidatorOptions};
|
||||||
use solana_faucet::faucet::run_local_faucet;
|
use solana_faucet::faucet::run_local_faucet;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
use solana_cli::{
|
use solana_cli::{
|
||||||
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
|
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
|
||||||
offline::{blockhash_query::BlockhashQuery, *},
|
|
||||||
spend_utils::SpendAmount,
|
spend_utils::SpendAmount,
|
||||||
test_utils::check_recent_balance,
|
test_utils::check_recent_balance,
|
||||||
};
|
};
|
||||||
use solana_client::rpc_client::RpcClient;
|
use solana_client::{
|
||||||
|
blockhash_query::{self, BlockhashQuery},
|
||||||
|
rpc_client::RpcClient,
|
||||||
|
};
|
||||||
use solana_core::test_validator::TestValidator;
|
use solana_core::test_validator::TestValidator;
|
||||||
use solana_faucet::faucet::run_local_faucet;
|
use solana_faucet::faucet::run_local_faucet;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
|
@ -11,6 +11,7 @@ edition = "2018"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
bincode = "1.3.1"
|
bincode = "1.3.1"
|
||||||
bs58 = "0.3.1"
|
bs58 = "0.3.1"
|
||||||
|
clap = "2.33.0"
|
||||||
indicatif = "0.15.0"
|
indicatif = "0.15.0"
|
||||||
jsonrpc-core = "14.2.0"
|
jsonrpc-core = "14.2.0"
|
||||||
log = "0.4.8"
|
log = "0.4.8"
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
use super::*;
|
use crate::{nonce_utils, rpc_client::RpcClient};
|
||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
use solana_clap_utils::{
|
use solana_clap_utils::{
|
||||||
input_parsers::{pubkey_of, value_of},
|
input_parsers::{pubkey_of, value_of},
|
||||||
nonce::*,
|
nonce::*,
|
||||||
offline::*,
|
offline::*,
|
||||||
};
|
};
|
||||||
use solana_client::nonce_utils;
|
use solana_sdk::{
|
||||||
use solana_sdk::commitment_config::CommitmentConfig;
|
commitment_config::CommitmentConfig, fee_calculator::FeeCalculator, hash::Hash, pubkey::Pubkey,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Source {
|
pub enum Source {
|
||||||
@ -115,17 +116,15 @@ impl Default for BlockhashQuery {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::offline::blockhash_query::{self, BlockhashQuery};
|
use crate::{
|
||||||
use clap::App;
|
blockhash_query,
|
||||||
use serde_json::{self, json, Value};
|
|
||||||
use solana_account_decoder::{UiAccount, UiAccountEncoding};
|
|
||||||
use solana_client::{
|
|
||||||
rpc_request::RpcRequest,
|
rpc_request::RpcRequest,
|
||||||
rpc_response::{Response, RpcFeeCalculator, RpcResponseContext},
|
rpc_response::{Response, RpcFeeCalculator, RpcResponseContext},
|
||||||
};
|
};
|
||||||
use solana_sdk::{
|
use clap::App;
|
||||||
account::Account, fee_calculator::FeeCalculator, hash::hash, nonce, system_program,
|
use serde_json::{self, json, Value};
|
||||||
};
|
use solana_account_decoder::{UiAccount, UiAccountEncoding};
|
||||||
|
use solana_sdk::{account::Account, hash::hash, nonce, system_program};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
@ -1,6 +1,7 @@
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
pub mod blockhash_query;
|
||||||
pub mod client_error;
|
pub mod client_error;
|
||||||
pub mod http_sender;
|
pub mod http_sender;
|
||||||
pub mod mock_sender;
|
pub mod mock_sender;
|
||||||
|
Reference in New Issue
Block a user