Skip to content

Commit

Permalink
chore: cli wallet-status outputs pretty json
Browse files Browse the repository at this point in the history
Changes `neptune-cli wallet-status` to pretty-print json instead of
using wallet_status.to_string(), ie impl Display.

This change is motivated by the block explorer, which instructs users
to obiain utxo-index from output of wallet-status, but previously the
field was unlabelled and the output was badly formatted mostly without
newlines, making it quite human unfriendly.

With this change:
 + the utxo index is labelled as: aocl_leaf_index
 + digests are nicely hex formatted instead of BFieldElement list.
 + the output is nicely formatted and human readable
 + the output is also machine readable
  • Loading branch information
dan-da committed May 14, 2024
1 parent 5ef2423 commit e215cb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bin/neptune-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ async fn main() -> Result<()> {
}
Command::WalletStatus => {
let wallet_status: WalletStatus = client.wallet_status(ctx).await?;
println!("{}", wallet_status)
println!("{}", serde_json::to_string_pretty(&wallet_status)?);
}
Command::OwnReceivingAddress => {
let rec_addr: generation_address::ReceivingAddress =
Expand Down

0 comments on commit e215cb0

Please sign in to comment.