Move CLI blockhash_query module into client crate

This commit is contained in:
Trent Nelson 2020-09-22 16:06:14 -06:00 committed by Trent Nelson
parent 0c58123b45
commit ba353c2b1d
11 changed files with 43 additions and 41 deletions

1
Cargo.lock generated
View File

@ -3585,6 +3585,7 @@ dependencies = [
"assert_matches",
"bincode",
"bs58",
"clap",
"indicatif",
"jsonrpc-core",
"jsonrpc-http-server",

View File

@ -4,7 +4,7 @@ use crate::{
cluster_query::*,
display::{new_spinner_progress_bar, println_name_value, println_transaction},
nonce::*,
offline::{blockhash_query::BlockhashQuery, return_signers},
offline::return_signers,
spend_utils::*,
stake::*,
validator_info::*,
@ -26,6 +26,7 @@ use solana_clap_utils::{
offline::*,
};
use solana_client::{
blockhash_query::BlockhashQuery,
client_error::{ClientError, ClientErrorKind, Result as ClientResult},
nonce_utils,
rpc_client::RpcClient,
@ -2224,9 +2225,8 @@ pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, '
#[cfg(test)]
mod tests {
use super::*;
use crate::offline::*;
use serde_json::Value;
use solana_client::mock_sender::SIGNATURE;
use solana_client::{blockhash_query, mock_sender::SIGNATURE};
use solana_sdk::{
pubkey::Pubkey,
signature::{keypair_from_seed, read_keypair_file, write_keypair_file, Presigner},

View File

@ -1,11 +1,7 @@
pub mod blockhash_query;
use crate::cli_output::{CliSignOnlyData, OutputFormat};
use serde_json::Value;
use solana_clap_utils::keypair::presigner_from_pubkey_sigs;
use solana_client::rpc_client::RpcClient;
use solana_sdk::{
fee_calculator::FeeCalculator,
hash::Hash,
pubkey::Pubkey,
signature::{Presigner, Signature},

View File

@ -6,7 +6,7 @@ use crate::{
},
cli_output::{CliStakeHistory, CliStakeHistoryEntry, CliStakeState, CliStakeType},
nonce::check_nonce_account,
offline::{blockhash_query::BlockhashQuery, return_signers},
offline::return_signers,
spend_utils::{resolve_spend_tx_and_check_account_balances, SpendAmount},
};
use clap::{App, Arg, ArgGroup, ArgMatches, SubCommand};
@ -20,7 +20,8 @@ use solana_clap_utils::{
ArgConstant,
};
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_sdk::{
@ -1770,10 +1771,8 @@ pub fn process_delegate_stake(
#[cfg(test)]
mod tests {
use super::*;
use crate::{
cli::{app, parse_command},
offline::blockhash_query,
};
use crate::cli::{app, parse_command};
use solana_client::blockhash_query;
use solana_sdk::{
hash::Hash,
signature::{

View File

@ -1,14 +1,15 @@
use solana_cli::{
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
cli_output::OutputFormat,
offline::{
blockhash_query::{self, BlockhashQuery},
parse_sign_only_reply_string,
},
offline::parse_sign_only_reply_string,
spend_utils::SpendAmount,
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::test_validator::{TestValidator, TestValidatorOptions};
use solana_faucet::faucet::run_local_faucet;

View File

@ -1,14 +1,15 @@
use solana_cli::{
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
cli_output::OutputFormat,
offline::{
blockhash_query::{self, BlockhashQuery},
parse_sign_only_reply_string,
},
offline::parse_sign_only_reply_string,
spend_utils::SpendAmount,
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_faucet::faucet::run_local_faucet;
use solana_sdk::{

View File

@ -1,14 +1,15 @@
use solana_cli::{
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
cli_output::OutputFormat,
offline::{
blockhash_query::{self, BlockhashQuery},
parse_sign_only_reply_string,
},
offline::parse_sign_only_reply_string,
spend_utils::SpendAmount,
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_faucet::faucet::run_local_faucet;
use solana_sdk::{

View File

@ -1,10 +1,12 @@
use solana_cli::{
cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
offline::{blockhash_query::BlockhashQuery, *},
spend_utils::SpendAmount,
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_faucet::faucet::run_local_faucet;
use solana_sdk::{

View File

@ -11,6 +11,7 @@ edition = "2018"
[dependencies]
bincode = "1.3.1"
bs58 = "0.3.1"
clap = "2.33.0"
indicatif = "0.15.0"
jsonrpc-core = "14.2.0"
log = "0.4.8"

View File

@ -1,12 +1,13 @@
use super::*;
use crate::{nonce_utils, rpc_client::RpcClient};
use clap::ArgMatches;
use solana_clap_utils::{
input_parsers::{pubkey_of, value_of},
nonce::*,
offline::*,
};
use solana_client::nonce_utils;
use solana_sdk::commitment_config::CommitmentConfig;
use solana_sdk::{
commitment_config::CommitmentConfig, fee_calculator::FeeCalculator, hash::Hash, pubkey::Pubkey,
};
#[derive(Debug, PartialEq)]
pub enum Source {
@ -115,17 +116,15 @@ impl Default for BlockhashQuery {
#[cfg(test)]
mod tests {
use super::*;
use crate::offline::blockhash_query::{self, BlockhashQuery};
use clap::App;
use serde_json::{self, json, Value};
use solana_account_decoder::{UiAccount, UiAccountEncoding};
use solana_client::{
use crate::{
blockhash_query,
rpc_request::RpcRequest,
rpc_response::{Response, RpcFeeCalculator, RpcResponseContext},
};
use solana_sdk::{
account::Account, fee_calculator::FeeCalculator, hash::hash, nonce, system_program,
};
use clap::App;
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;
#[test]

View File

@ -1,6 +1,7 @@
#[macro_use]
extern crate serde_derive;
pub mod blockhash_query;
pub mod client_error;
pub mod http_sender;
pub mod mock_sender;