From 724c311ca22cf3b9f3fc304bfffb4e67eaf7fe42 Mon Sep 17 00:00:00 2001 From: lunar-mining Date: Mon, 11 Oct 2021 11:06:03 +0200 Subject: [PATCH] drk: made server replies more legible --- src/bin/drk.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/bin/drk.rs b/src/bin/drk.rs index 2e26ad02b..328edcf2c 100644 --- a/src/bin/drk.rs +++ b/src/bin/drk.rs @@ -156,19 +156,27 @@ async fn start(config: &DrkConfig, options: ArgMatches<'_>) -> Result<()> { if let Some(matches) = options.subcommand_matches("wallet") { if matches.is_present("create") { let reply = client.create_wallet().await?; - println!("Server replied: {}", &reply.to_string()); + if reply.as_bool().unwrap() == true { + println!("Wallet created successfully.") + } else { + println!("Server replied: {}", &reply.to_string()); + } return Ok(()); } if matches.is_present("keygen") { let reply = client.key_gen().await?; - println!("Server replied: {}", &reply.to_string()); + if reply.as_bool().unwrap() == true { + println!("Key generation successful.") + } else { + println!("Server replied: {}", &reply.to_string()); + } return Ok(()); } if matches.is_present("address") { let reply = client.get_key().await?; - println!("Server replied: {}", &reply.to_string()); + println!("Wallet address: {}", &reply.to_string()); return Ok(()); } @@ -204,13 +212,13 @@ async fn start(config: &DrkConfig, options: ArgMatches<'_>) -> Result<()> { let reply = client.get_token_id(&network, &token).await?; - println!("Server replied: {}", &reply.to_string()); + println!("Token ID: {}", &reply.to_string()); return Ok(()); } if options.is_present("features") { let reply = client.features().await?; - println!("Server replied: {}", &reply.to_string()); + println!("Features: {}", &reply.to_string()); return Ok(()); }