main

only changed error handling here
 avatar
unknown
rust
24 days ago
486 B
11
Indexable
use balance::{recover_wallet_state, EXTENDED_PRIVATE_KEY, WALLET_NAME};

fn main() {
    // Replace unwrap() with proper error handling
    let wallet_state = match recover_wallet_state(EXTENDED_PRIVATE_KEY) {
        Ok(state) => state,
        Err(e) => {
            eprintln!("Failed to recover wallet state: {:?}", e);
            std::process::exit(1);
        }
    };
    
    let balance = wallet_state.balance();
    println!("{} {:.8}", WALLET_NAME, balance);
}
Leave a Comment