watcher/shared/src/lib.rs
Victor Vobis 954a7219b0 bless
2025-09-04 20:00:37 +02:00

35 lines
593 B
Rust

pub mod core {
pub mod block;
pub use block::*;
pub mod tx;
pub use tx::*;
pub mod data;
pub use data::*;
pub mod hasher;
pub use hasher::*;
pub mod address;
pub use address::*;
}
pub fn print_error_chain(err: &anyhow::Error) {
let mut err_string = String::from(format!("Error: {}\n", err));
let mut source = err.source();
let mut level = 1;
while let Some(err) = source {
err_string.push_str(format!(" {}: {}\n", level, err).as_str());
source = err.source();
level += 1;
}
log(err_string)
}
pub fn log(msg: String) {
println!("{msg}")
}