From e215cb05f1dfe780b246aafb0e63301a708ed85b Mon Sep 17 00:00:00 2001 From: danda Date: Mon, 13 May 2024 21:46:06 -0700 Subject: [PATCH] chore: cli wallet-status outputs pretty json 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 --- src/bin/neptune-cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/neptune-cli.rs b/src/bin/neptune-cli.rs index 6a8afdcc..35670a5e 100644 --- a/src/bin/neptune-cli.rs +++ b/src/bin/neptune-cli.rs @@ -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 =