Skip to content

Commit

Permalink
CLI: don't call functions in macros (#1758)
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Dec 8, 2023
1 parent 49c9468 commit 76142f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ pub async fn mnemonic_command(output_file_name: Option<String>, output_stdout: O

pub async fn node_info_command(storage_path: &Path) -> Result<Wallet, Error> {
let wallet = unlock_wallet(storage_path, None, None).await?;
let node_info = wallet.client().get_info().await?;
let node_info = serde_json::to_string_pretty(&wallet.client().get_info().await?)?;

println_log_info!("Current node info: {}", serde_json::to_string_pretty(&node_info)?);
println_log_info!("Current node info: {node_info}");

Ok(wallet)
}
Expand Down
11 changes: 7 additions & 4 deletions cli/src/wallet_cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,15 +571,18 @@ pub async fn faucet_command(wallet: &Wallet, address: Option<Bech32Address>, url
};

let faucet_url = url.as_deref().unwrap_or("http://localhost:8088/api/enqueue");
let response = request_funds_from_faucet(faucet_url, &address).await?;

println_log_info!("{}", request_funds_from_faucet(faucet_url, &address).await?);
println_log_info!("{response}");

Ok(())
}

// `implicit-account-creation-address` command
pub async fn implicit_account_creation_address_command(wallet: &Wallet) -> Result<(), Error> {
println_log_info!("{}", wallet.implicit_account_creation_address().await?);
let address = wallet.implicit_account_creation_address().await?;

println_log_info!("{address}");

Ok(())
}
Expand Down Expand Up @@ -689,9 +692,9 @@ pub async fn mint_nft_command(

// `node-info` command
pub async fn node_info_command(wallet: &Wallet) -> Result<(), Error> {
let node_info = wallet.client().get_info().await?;
let node_info = serde_json::to_string_pretty(&wallet.client().get_info().await?)?;

println_log_info!("Current node info: {}", serde_json::to_string_pretty(&node_info)?);
println_log_info!("Current node info: {node_info}");

Ok(())
}
Expand Down

0 comments on commit 76142f6

Please sign in to comment.