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:
Jon Cinque
2021-10-26 22:54:26 +02:00
committed by GitHub
parent 4d6190a1ba
commit 5f7b60576f
6 changed files with 192 additions and 173 deletions

11
client/src/spinner.rs Normal file
View File

@@ -0,0 +1,11 @@
//! Spinner creator
use indicatif::{ProgressBar, ProgressStyle};
pub(crate) fn new_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
}