From 5b24b6d0c976cd27b75c864f6bde071fabb89242 Mon Sep 17 00:00:00 2001 From: Pawel Iwan Date: Fri, 28 Jul 2023 19:32:42 +0200 Subject: [PATCH] feat: extend list of outputs for `unspent-outputs` --- cli/CHANGELOG.md | 2 +- cli/src/command/account.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 443d0a23f5..172c5ad0d6 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `WalletCommand::Accounts` variant to list all available accounts in a wallet; - `addresses` now additionally prints the hex version of the address; -- `outputs` prints a list that includes number and type of the output; +- `outputs`, `unspent-outputs` print a list that includes number and type of the output; ## 1.0.0 - 2023-07-27 diff --git a/cli/src/command/account.rs b/cli/src/command/account.rs index fce198add9..6192099b14 100644 --- a/cli/src/command/account.rs +++ b/cli/src/command/account.rs @@ -627,6 +627,7 @@ pub async fn outputs_command(account: &Account) -> Result<(), Error> { if outputs.is_empty() { println_log_info!("No outputs found"); } else { + println_log_info!("Outputs:"); for (i, output_data) in outputs.into_iter().enumerate() { println_log_info!("{}\t{}\t{}", i, &output_data.output_id, output_data.output.kind_str()); } @@ -786,8 +787,10 @@ pub async fn unspent_outputs_command(account: &Account) -> Result<(), Error> { if outputs.is_empty() { println_log_info!("No outputs found"); } else { - let output_ids: Vec = outputs.iter().map(|o| o.output_id).collect(); - println_log_info!("Unspent outputs: {output_ids:#?}"); + println_log_info!("Unspent outputs:"); + for (i, output_data) in outputs.into_iter().enumerate() { + println_log_info!("{}\t{}\t{}", i, &output_data.output_id, output_data.output.kind_str()); + } } Ok(())