drk: made server replies more legible

This commit is contained in:
lunar-mining
2021-10-11 11:06:03 +02:00
parent fa8a07d4ca
commit 724c311ca2

View File

@@ -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(());
}