Skip to content

Commit

Permalink
feat: extend list of outputs for unspent-outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
qrayven committed Jul 28, 2023
1 parent fb7590b commit 5b24b6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions cli/src/command/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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<OutputId> = 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(())
Expand Down

0 comments on commit 5b24b6d

Please sign in to comment.