From f82294b49a35e796759c4ff3802b9274ac0afb98 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:48:50 -0700 Subject: [PATCH] fixes --- errors/src/errors/package/package_errors.rs | 2 +- errors/src/errors/utils/util_errors.rs | 6 +++--- leo/cli/commands/mod.rs | 4 ++-- leo/cli/helpers/context.rs | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/errors/src/errors/package/package_errors.rs b/errors/src/errors/package/package_errors.rs index 2df8fb55d8..c33ca4accd 100644 --- a/errors/src/errors/package/package_errors.rs +++ b/errors/src/errors/package/package_errors.rs @@ -407,7 +407,7 @@ create_messages!( @backtraced insufficient_balance { - args: (balance: impl Display, fee: impl Display), + args: (address: impl Display, balance: impl Display, fee: impl Display), msg: format!("❌ Your public balance of {balance} for {address} is insufficient to pay the base fee of {fee}"), help: None, } diff --git a/errors/src/errors/utils/util_errors.rs b/errors/src/errors/utils/util_errors.rs index d7a6c7ca69..ee94964810 100644 --- a/errors/src/errors/utils/util_errors.rs +++ b/errors/src/errors/utils/util_errors.rs @@ -50,14 +50,14 @@ create_messages!( @formatted snarkvm_parsing_error { args: (), - msg: format!("SnarkVM failure to parse `.aleo` program"), + msg: "SnarkVM failure to parse `.aleo` program".to_string(), help: None, } @formatted circular_dependency_error { args: (), - msg: format!("Circular dependency detected"), + msg: "Circular dependency detected".to_string(), help: None, } @@ -65,7 +65,7 @@ create_messages!( network_error { args: (url: impl Display, status: impl Display), msg: format!("Failed network request to {url}. Status: {status}"), - help: Some("Make sure that you are using the correct `--network` and `--endpoint` options.".to_string()) + help: Some("Make sure that you are using the correct `--network` and `--endpoint` options.".to_string()), } @formatted diff --git a/leo/cli/commands/mod.rs b/leo/cli/commands/mod.rs index 6a56c2327b..99fd2a46d0 100644 --- a/leo/cli/commands/mod.rs +++ b/leo/cli/commands/mod.rs @@ -208,7 +208,7 @@ impl Default for BuildOptions { /// On Chain Execution Options to set preferences for keys, fees and networks. /// Used by Execute and Deploy commands. -#[derive(Parser, Clone, Debug)] +#[derive(Parser, Clone, Debug, Default)] pub struct FeeOptions { #[clap(short, long, help = "Performs a dry-run of transaction generation")] pub(crate) dry_run: bool, @@ -265,7 +265,7 @@ fn check_balance( public_balance.truncate(public_balance.len() - 3); // Compare balance. if public_balance.parse::().unwrap() < total_cost { - Err(PackageError::insufficient_balance(public_balance, total_cost).into()) + Err(PackageError::insufficient_balance(address, public_balance, total_cost).into()) } else { Ok(()) } diff --git a/leo/cli/helpers/context.rs b/leo/cli/helpers/context.rs index 007c5f9075..ca1cbdde3e 100644 --- a/leo/cli/helpers/context.rs +++ b/leo/cli/helpers/context.rs @@ -40,6 +40,7 @@ pub struct Context { /// Path to use for the Aleo registry, None when default pub home: Option, /// Recursive flag. + // TODO: Shift from callee to caller by including display method pub recursive: bool, }