tpu-client: Move send_messages_with_spinner
from program (#20960)
We have too many ways of sending transactions, and too many reimplementations of the same logic all over the place. The program deploy logic and stake-o-matic currently make the most use of the TPU client, so this merges their implementations into one place to be reused by both. Yay for consolidation!
This commit is contained in:
@@ -21,9 +21,9 @@ use {
|
||||
rpc_request::{RpcError, RpcRequest, RpcResponseErrorData, TokenAccountsFilter},
|
||||
rpc_response::*,
|
||||
rpc_sender::*,
|
||||
spinner,
|
||||
},
|
||||
bincode::serialize,
|
||||
indicatif::{ProgressBar, ProgressStyle},
|
||||
log::*,
|
||||
serde_json::{json, Value},
|
||||
solana_account_decoder::{
|
||||
@@ -1062,7 +1062,7 @@ impl RpcClient {
|
||||
};
|
||||
let mut confirmations = 0;
|
||||
|
||||
let progress_bar = new_spinner_progress_bar();
|
||||
let progress_bar = spinner::new_progress_bar();
|
||||
|
||||
progress_bar.set_message(format!(
|
||||
"[{}/{}] Finalizing transaction {}",
|
||||
@@ -4876,14 +4876,6 @@ pub struct GetConfirmedSignaturesForAddress2Config {
|
||||
pub commitment: Option<CommitmentConfig>,
|
||||
}
|
||||
|
||||
fn new_spinner_progress_bar() -> ProgressBar {
|
||||
let progress_bar = ProgressBar::new(42);
|
||||
progress_bar
|
||||
.set_style(ProgressStyle::default_spinner().template("{spinner:.green} {wide_msg}"));
|
||||
progress_bar.enable_steady_tick(100);
|
||||
progress_bar
|
||||
}
|
||||
|
||||
fn get_rpc_request_str(rpc_addr: SocketAddr, tls: bool) -> String {
|
||||
if tls {
|
||||
format!("https://{}", rpc_addr)
|
||||
|
Reference in New Issue
Block a user