Преглед на файлове

use solana-commitment-config instead of solana-sdk in solana-cli (#4375)

Kevin Heavey преди 10 месеца
родител
ревизия
2a566a4bbc

+ 1 - 0
Cargo.lock

@@ -6529,6 +6529,7 @@ dependencies = [
  "solana-cli-config",
  "solana-cli-config",
  "solana-cli-output",
  "solana-cli-output",
  "solana-client",
  "solana-client",
+ "solana-commitment-config",
  "solana-compute-budget",
  "solana-compute-budget",
  "solana-config-program",
  "solana-config-program",
  "solana-connection-cache",
  "solana-connection-cache",

+ 1 - 0
cli/Cargo.toml

@@ -34,6 +34,7 @@ solana-clap-utils = { workspace = true }
 solana-cli-config = { workspace = true }
 solana-cli-config = { workspace = true }
 solana-cli-output = { workspace = true }
 solana-cli-output = { workspace = true }
 solana-client = { workspace = true }
 solana-client = { workspace = true }
+solana-commitment-config = { workspace = true }
 solana-compute-budget = { workspace = true }
 solana-compute-budget = { workspace = true }
 solana-config-program = { workspace = true }
 solana-config-program = { workspace = true }
 solana-connection-cache = { workspace = true }
 solana-connection-cache = { workspace = true }

+ 1 - 1
cli/src/address_lookup_table.rs

@@ -3,6 +3,7 @@ use {
     clap::{App, AppSettings, Arg, ArgMatches, SubCommand},
     clap::{App, AppSettings, Arg, ArgMatches, SubCommand},
     solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*},
     solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*},
     solana_cli_output::{CliAddressLookupTable, CliAddressLookupTableCreated, CliSignature},
     solana_cli_output::{CliAddressLookupTable, CliAddressLookupTableCreated, CliSignature},
+    solana_commitment_config::CommitmentConfig,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client_api::config::RpcSendTransactionConfig,
     solana_rpc_client_api::config::RpcSendTransactionConfig,
@@ -17,7 +18,6 @@ use {
             state::AddressLookupTable,
             state::AddressLookupTable,
         },
         },
         clock::Clock,
         clock::Clock,
-        commitment_config::CommitmentConfig,
         message::Message,
         message::Message,
         pubkey::Pubkey,
         pubkey::Pubkey,
         signer::Signer,
         signer::Signer,

+ 2 - 4
cli/src/checks.rs

@@ -1,11 +1,9 @@
 use {
 use {
     crate::cli::CliError,
     crate::cli::CliError,
+    solana_commitment_config::CommitmentConfig,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client_api::client_error::{Error as ClientError, Result as ClientResult},
     solana_rpc_client_api::client_error::{Error as ClientError, Result as ClientResult},
-    solana_sdk::{
-        commitment_config::CommitmentConfig, message::Message, native_token::lamports_to_sol,
-        pubkey::Pubkey,
-    },
+    solana_sdk::{message::Message, native_token::lamports_to_sol, pubkey::Pubkey},
 };
 };
 
 
 pub fn check_account_for_fee(
 pub fn check_account_for_fee(

+ 1 - 1
cli/src/cli.rs

@@ -13,6 +13,7 @@ use {
         display::println_name_value, CliSignature, CliValidatorsSortOrder, OutputFormat,
         display::println_name_value, CliSignature, CliValidatorsSortOrder, OutputFormat,
     },
     },
     solana_client::connection_cache::ConnectionCache,
     solana_client::connection_cache::ConnectionCache,
+    solana_commitment_config::CommitmentConfig,
     solana_decode_error::DecodeError,
     solana_decode_error::DecodeError,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
@@ -23,7 +24,6 @@ use {
     solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
     solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
     solana_sdk::{
     solana_sdk::{
         clock::{Epoch, Slot},
         clock::{Epoch, Slot},
-        commitment_config::CommitmentConfig,
         hash::Hash,
         hash::Hash,
         instruction::InstructionError,
         instruction::InstructionError,
         offchain_message::OffchainMessage,
         offchain_message::OffchainMessage,

+ 1 - 1
cli/src/cluster_query.rs

@@ -26,6 +26,7 @@ use {
         },
         },
         *,
         *,
     },
     },
+    solana_commitment_config::CommitmentConfig,
     solana_pubsub_client::pubsub_client::PubsubClient,
     solana_pubsub_client::pubsub_client::PubsubClient,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_rpc_client::rpc_client::{GetConfirmedSignaturesForAddress2Config, RpcClient},
     solana_rpc_client::rpc_client::{GetConfirmedSignaturesForAddress2Config, RpcClient},
@@ -44,7 +45,6 @@ use {
         account::from_account,
         account::from_account,
         account_utils::StateMut,
         account_utils::StateMut,
         clock::{self, Clock, Slot},
         clock::{self, Clock, Slot},
-        commitment_config::CommitmentConfig,
         epoch_schedule::Epoch,
         epoch_schedule::Epoch,
         hash::Hash,
         hash::Hash,
         message::Message,
         message::Message,

+ 1 - 1
cli/src/program.rs

@@ -39,6 +39,7 @@ use {
         },
         },
         tpu_client::{TpuClient, TpuClientConfig},
         tpu_client::{TpuClient, TpuClientConfig},
     },
     },
+    solana_commitment_config::CommitmentConfig,
     solana_compute_budget::compute_budget::ComputeBudget,
     solana_compute_budget::compute_budget::ComputeBudget,
     solana_feature_set::{FeatureSet, FEATURE_NAMES},
     solana_feature_set::{FeatureSet, FEATURE_NAMES},
     solana_program_runtime::invoke_context::InvokeContext,
     solana_program_runtime::invoke_context::InvokeContext,
@@ -57,7 +58,6 @@ use {
         account_utils::StateMut,
         account_utils::StateMut,
         bpf_loader, bpf_loader_deprecated,
         bpf_loader, bpf_loader_deprecated,
         bpf_loader_upgradeable::{self, get_program_data_address, UpgradeableLoaderState},
         bpf_loader_upgradeable::{self, get_program_data_address, UpgradeableLoaderState},
-        commitment_config::CommitmentConfig,
         compute_budget,
         compute_budget,
         instruction::{Instruction, InstructionError},
         instruction::{Instruction, InstructionError},
         message::Message,
         message::Message,

+ 2 - 4
cli/src/spend_utils.rs

@@ -8,11 +8,9 @@ use {
     solana_clap_utils::{
     solana_clap_utils::{
         compute_budget::ComputeUnitLimit, input_parsers::lamports_of_sol, offline::SIGN_ONLY_ARG,
         compute_budget::ComputeUnitLimit, input_parsers::lamports_of_sol, offline::SIGN_ONLY_ARG,
     },
     },
+    solana_commitment_config::CommitmentConfig,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
-    solana_sdk::{
-        commitment_config::CommitmentConfig, hash::Hash, message::Message,
-        native_token::lamports_to_sol, pubkey::Pubkey,
-    },
+    solana_sdk::{hash::Hash, message::Message, native_token::lamports_to_sol, pubkey::Pubkey},
 };
 };
 
 
 #[derive(Debug, PartialEq, Eq, Clone, Copy)]
 #[derive(Debug, PartialEq, Eq, Clone, Copy)]

+ 1 - 1
cli/src/stake.rs

@@ -31,6 +31,7 @@ use {
         CliEpochReward, CliStakeHistory, CliStakeHistoryEntry, CliStakeState, CliStakeType,
         CliEpochReward, CliStakeHistory, CliStakeHistoryEntry, CliStakeState, CliStakeType,
         OutputFormat, ReturnSignersConfig,
         OutputFormat, ReturnSignersConfig,
     },
     },
+    solana_commitment_config::CommitmentConfig,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client_api::{
     solana_rpc_client_api::{
@@ -43,7 +44,6 @@ use {
         account::{from_account, Account},
         account::{from_account, Account},
         account_utils::StateMut,
         account_utils::StateMut,
         clock::{Clock, UnixTimestamp, SECONDS_PER_DAY},
         clock::{Clock, UnixTimestamp, SECONDS_PER_DAY},
-        commitment_config::CommitmentConfig,
         epoch_schedule::EpochSchedule,
         epoch_schedule::EpochSchedule,
         message::Message,
         message::Message,
         native_token::Sol,
         native_token::Sol,

+ 2 - 4
cli/src/test_utils.rs

@@ -1,9 +1,7 @@
 use {
 use {
+    solana_commitment_config::CommitmentConfig,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
-    solana_sdk::{
-        clock::{Epoch, DEFAULT_MS_PER_SLOT},
-        commitment_config::CommitmentConfig,
-    },
+    solana_sdk::clock::{Epoch, DEFAULT_MS_PER_SLOT},
     std::{thread::sleep, time::Duration},
     std::{thread::sleep, time::Duration},
 };
 };
 
 

+ 3 - 3
cli/src/vote.rs

@@ -28,14 +28,14 @@ use {
         return_signers_with_config, CliEpochVotingHistory, CliLandedVote, CliVoteAccount,
         return_signers_with_config, CliEpochVotingHistory, CliLandedVote, CliVoteAccount,
         ReturnSignersConfig,
         ReturnSignersConfig,
     },
     },
+    solana_commitment_config::CommitmentConfig,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client_api::config::RpcGetVoteAccountsConfig,
     solana_rpc_client_api::config::RpcGetVoteAccountsConfig,
     solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
     solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
     solana_sdk::{
     solana_sdk::{
-        account::Account, commitment_config::CommitmentConfig, message::Message,
-        native_token::lamports_to_sol, pubkey::Pubkey, system_instruction::SystemError,
-        transaction::Transaction,
+        account::Account, message::Message, native_token::lamports_to_sol, pubkey::Pubkey,
+        system_instruction::SystemError, transaction::Transaction,
     },
     },
     solana_vote_program::{
     solana_vote_program::{
         vote_error::VoteError,
         vote_error::VoteError,

+ 1 - 1
cli/src/wallet.rs

@@ -28,12 +28,12 @@ use {
         CliSignatureVerificationStatus, CliTransaction, CliTransactionConfirmation, OutputFormat,
         CliSignatureVerificationStatus, CliTransaction, CliTransactionConfirmation, OutputFormat,
         ReturnSignersConfig,
         ReturnSignersConfig,
     },
     },
+    solana_commitment_config::CommitmentConfig,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_remote_wallet::remote_wallet::RemoteWalletManager,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client_api::config::RpcTransactionConfig,
     solana_rpc_client_api::config::RpcTransactionConfig,
     solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
     solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
     solana_sdk::{
     solana_sdk::{
-        commitment_config::CommitmentConfig,
         message::Message,
         message::Message,
         offchain_message::OffchainMessage,
         offchain_message::OffchainMessage,
         pubkey::Pubkey,
         pubkey::Pubkey,

+ 1 - 1
cli/tests/cluster_query.rs

@@ -4,10 +4,10 @@ use {
         cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
         cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
         test_utils::check_ready,
         test_utils::check_ready,
     },
     },
+    solana_commitment_config::CommitmentConfig,
     solana_faucet::faucet::run_local_faucet,
     solana_faucet::faucet::run_local_faucet,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_sdk::{
     solana_sdk::{
-        commitment_config::CommitmentConfig,
         fee::FeeStructure,
         fee::FeeStructure,
         native_token::sol_to_lamports,
         native_token::sol_to_lamports,
         signature::{Keypair, Signer},
         signature::{Keypair, Signer},

+ 1 - 1
cli/tests/nonce.rs

@@ -7,11 +7,11 @@ use {
         test_utils::check_ready,
         test_utils::check_ready,
     },
     },
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
+    solana_commitment_config::CommitmentConfig,
     solana_faucet::faucet::run_local_faucet,
     solana_faucet::faucet::run_local_faucet,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client_nonce_utils::blockhash_query::{self, BlockhashQuery},
     solana_rpc_client_nonce_utils::blockhash_query::{self, BlockhashQuery},
     solana_sdk::{
     solana_sdk::{
-        commitment_config::CommitmentConfig,
         hash::Hash,
         hash::Hash,
         native_token::sol_to_lamports,
         native_token::sol_to_lamports,
         pubkey::Pubkey,
         pubkey::Pubkey,

+ 1 - 1
cli/tests/program.rs

@@ -12,6 +12,7 @@ use {
     },
     },
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
     solana_client::rpc_config::RpcSendTransactionConfig,
     solana_client::rpc_config::RpcSendTransactionConfig,
+    solana_commitment_config::CommitmentConfig,
     solana_faucet::faucet::run_local_faucet,
     solana_faucet::faucet::run_local_faucet,
     solana_feature_set::enable_alt_bn128_syscall,
     solana_feature_set::enable_alt_bn128_syscall,
     solana_rpc::rpc::JsonRpcConfig,
     solana_rpc::rpc::JsonRpcConfig,
@@ -23,7 +24,6 @@ use {
         account_utils::StateMut,
         account_utils::StateMut,
         borsh1::try_from_slice_unchecked,
         borsh1::try_from_slice_unchecked,
         bpf_loader_upgradeable::{self, UpgradeableLoaderState},
         bpf_loader_upgradeable::{self, UpgradeableLoaderState},
-        commitment_config::CommitmentConfig,
         compute_budget::{self, ComputeBudgetInstruction},
         compute_budget::{self, ComputeBudgetInstruction},
         fee_calculator::FeeRateGovernor,
         fee_calculator::FeeRateGovernor,
         pubkey::Pubkey,
         pubkey::Pubkey,

+ 1 - 1
cli/tests/request_airdrop.rs

@@ -1,10 +1,10 @@
 #![allow(clippy::arithmetic_side_effects)]
 #![allow(clippy::arithmetic_side_effects)]
 use {
 use {
     solana_cli::cli::{process_command, CliCommand, CliConfig},
     solana_cli::cli::{process_command, CliCommand, CliConfig},
+    solana_commitment_config::CommitmentConfig,
     solana_faucet::faucet::run_local_faucet,
     solana_faucet::faucet::run_local_faucet,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_sdk::{
     solana_sdk::{
-        commitment_config::CommitmentConfig,
         native_token::sol_to_lamports,
         native_token::sol_to_lamports,
         signature::{Keypair, Signer},
         signature::{Keypair, Signer},
     },
     },

+ 1 - 1
cli/tests/stake.rs

@@ -9,13 +9,13 @@ use {
         test_utils::{check_ready, wait_for_next_epoch_plus_n_slots},
         test_utils::{check_ready, wait_for_next_epoch_plus_n_slots},
     },
     },
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
+    solana_commitment_config::CommitmentConfig,
     solana_faucet::faucet::run_local_faucet,
     solana_faucet::faucet::run_local_faucet,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client_api::request::DELINQUENT_VALIDATOR_SLOT_DISTANCE,
     solana_rpc_client_api::request::DELINQUENT_VALIDATOR_SLOT_DISTANCE,
     solana_rpc_client_nonce_utils::blockhash_query::{self, BlockhashQuery},
     solana_rpc_client_nonce_utils::blockhash_query::{self, BlockhashQuery},
     solana_sdk::{
     solana_sdk::{
         account_utils::StateMut,
         account_utils::StateMut,
-        commitment_config::CommitmentConfig,
         epoch_schedule::EpochSchedule,
         epoch_schedule::EpochSchedule,
         fee::FeeStructure,
         fee::FeeStructure,
         fee_calculator::FeeRateGovernor,
         fee_calculator::FeeRateGovernor,

+ 1 - 1
cli/tests/transfer.rs

@@ -7,11 +7,11 @@ use {
         test_utils::check_ready,
         test_utils::check_ready,
     },
     },
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
+    solana_commitment_config::CommitmentConfig,
     solana_faucet::faucet::run_local_faucet,
     solana_faucet::faucet::run_local_faucet,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client_nonce_utils::blockhash_query::{self, BlockhashQuery},
     solana_rpc_client_nonce_utils::blockhash_query::{self, BlockhashQuery},
     solana_sdk::{
     solana_sdk::{
-        commitment_config::CommitmentConfig,
         compute_budget::ComputeBudgetInstruction,
         compute_budget::ComputeBudgetInstruction,
         fee::FeeStructure,
         fee::FeeStructure,
         message::Message,
         message::Message,

+ 2 - 4
cli/tests/validator_info.rs

@@ -4,12 +4,10 @@ use {
         check_balance,
         check_balance,
         cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
         cli::{process_command, request_and_confirm_airdrop, CliCommand, CliConfig},
     },
     },
+    solana_commitment_config::CommitmentConfig,
     solana_faucet::faucet::run_local_faucet,
     solana_faucet::faucet::run_local_faucet,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
-    solana_sdk::{
-        commitment_config::CommitmentConfig,
-        signature::{keypair_from_seed, Keypair, Signer},
-    },
+    solana_sdk::signature::{keypair_from_seed, Keypair, Signer},
     solana_streamer::socket::SocketAddrSpace,
     solana_streamer::socket::SocketAddrSpace,
     solana_test_validator::TestValidator,
     solana_test_validator::TestValidator,
     test_case::test_case,
     test_case::test_case,

+ 1 - 1
cli/tests/vote.rs

@@ -6,12 +6,12 @@ use {
         spend_utils::SpendAmount,
         spend_utils::SpendAmount,
     },
     },
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
     solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
+    solana_commitment_config::CommitmentConfig,
     solana_faucet::faucet::run_local_faucet,
     solana_faucet::faucet::run_local_faucet,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client::rpc_client::RpcClient,
     solana_rpc_client_nonce_utils::blockhash_query::{self, BlockhashQuery},
     solana_rpc_client_nonce_utils::blockhash_query::{self, BlockhashQuery},
     solana_sdk::{
     solana_sdk::{
         account_utils::StateMut,
         account_utils::StateMut,
-        commitment_config::CommitmentConfig,
         signature::{Keypair, NullSigner, Signer},
         signature::{Keypair, NullSigner, Signer},
     },
     },
     solana_streamer::socket::SocketAddrSpace,
     solana_streamer::socket::SocketAddrSpace,