mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 13:23:10 +00:00
Merge pull request #229 from logos-blockchain/arjentix/iss-186-fix-wallet-sync-print-spam
Remove print spam when running wallet account sync-private
This commit is contained in:
commit
cd2430c2ee
@ -23,6 +23,7 @@ itertools.workspace = true
|
||||
sha2.workspace = true
|
||||
futures.workspace = true
|
||||
async-stream = "0.3.6"
|
||||
indicatif = { version = "0.18.3", features = ["improved_unicode"] }
|
||||
|
||||
[dependencies.key_protocol]
|
||||
path = "../key_protocol"
|
||||
|
||||
@ -8,6 +8,7 @@ use key_protocol::{
|
||||
},
|
||||
key_protocol_core::NSSAUserData,
|
||||
};
|
||||
use log::debug;
|
||||
use nssa::program::Program;
|
||||
|
||||
use crate::config::{InitialAccountData, PersistentAccountData, WalletConfig};
|
||||
@ -127,7 +128,7 @@ impl WalletChainStore {
|
||||
account_id: nssa::AccountId,
|
||||
account: nssa_core::account::Account,
|
||||
) {
|
||||
println!("inserting at address {account_id}, this account {account:?}");
|
||||
debug!("inserting at address {account_id}, this account {account:?}");
|
||||
|
||||
let entry = self
|
||||
.user_data
|
||||
|
||||
@ -326,11 +326,14 @@ impl WalletCore {
|
||||
}
|
||||
|
||||
let before_polling = std::time::Instant::now();
|
||||
let num_of_blocks = block_id - self.last_synced_block;
|
||||
println!("Syncing to block {block_id}. Blocks to sync: {num_of_blocks}");
|
||||
|
||||
let poller = self.poller.clone();
|
||||
let mut blocks =
|
||||
std::pin::pin!(poller.poll_block_range(self.last_synced_block + 1..=block_id));
|
||||
|
||||
let bar = indicatif::ProgressBar::new(num_of_blocks);
|
||||
while let Some(block) = blocks.try_next().await? {
|
||||
for tx in block.transactions {
|
||||
let nssa_tx = NSSATransaction::try_from(&tx)?;
|
||||
@ -339,7 +342,9 @@ impl WalletCore {
|
||||
|
||||
self.last_synced_block = block.block_id;
|
||||
self.store_persistent_data().await?;
|
||||
bar.inc(1);
|
||||
}
|
||||
bar.finish();
|
||||
|
||||
println!(
|
||||
"Synced to block {block_id} in {:?}",
|
||||
@ -399,7 +404,7 @@ impl WalletCore {
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
for (affected_account_id, new_acc) in affected_accounts {
|
||||
println!(
|
||||
info!(
|
||||
"Received new account for account_id {affected_account_id:#?} with account object {new_acc:#?}"
|
||||
);
|
||||
self.storage
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user