This commit is contained in:
evan-schott 2024-06-10 15:48:50 -07:00
parent 98a1314280
commit f82294b49a
4 changed files with 7 additions and 6 deletions

View File

@ -407,7 +407,7 @@ create_messages!(
@backtraced @backtraced
insufficient_balance { 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}"), msg: format!("❌ Your public balance of {balance} for {address} is insufficient to pay the base fee of {fee}"),
help: None, help: None,
} }

View File

@ -50,14 +50,14 @@ create_messages!(
@formatted @formatted
snarkvm_parsing_error { snarkvm_parsing_error {
args: (), args: (),
msg: format!("SnarkVM failure to parse `.aleo` program"), msg: "SnarkVM failure to parse `.aleo` program".to_string(),
help: None, help: None,
} }
@formatted @formatted
circular_dependency_error { circular_dependency_error {
args: (), args: (),
msg: format!("Circular dependency detected"), msg: "Circular dependency detected".to_string(),
help: None, help: None,
} }
@ -65,7 +65,7 @@ create_messages!(
network_error { network_error {
args: (url: impl Display, status: impl Display), args: (url: impl Display, status: impl Display),
msg: format!("Failed network request to {url}. Status: {status}"), 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 @formatted

View File

@ -208,7 +208,7 @@ impl Default for BuildOptions {
/// On Chain Execution Options to set preferences for keys, fees and networks. /// On Chain Execution Options to set preferences for keys, fees and networks.
/// Used by Execute and Deploy commands. /// Used by Execute and Deploy commands.
#[derive(Parser, Clone, Debug)] #[derive(Parser, Clone, Debug, Default)]
pub struct FeeOptions { pub struct FeeOptions {
#[clap(short, long, help = "Performs a dry-run of transaction generation")] #[clap(short, long, help = "Performs a dry-run of transaction generation")]
pub(crate) dry_run: bool, pub(crate) dry_run: bool,
@ -265,7 +265,7 @@ fn check_balance<N: Network>(
public_balance.truncate(public_balance.len() - 3); public_balance.truncate(public_balance.len() - 3);
// Compare balance. // Compare balance.
if public_balance.parse::<u64>().unwrap() < total_cost { if public_balance.parse::<u64>().unwrap() < total_cost {
Err(PackageError::insufficient_balance(public_balance, total_cost).into()) Err(PackageError::insufficient_balance(address, public_balance, total_cost).into())
} else { } else {
Ok(()) Ok(())
} }

View File

@ -40,6 +40,7 @@ pub struct Context {
/// Path to use for the Aleo registry, None when default /// Path to use for the Aleo registry, None when default
pub home: Option<PathBuf>, pub home: Option<PathBuf>,
/// Recursive flag. /// Recursive flag.
// TODO: Shift from callee to caller by including display method
pub recursive: bool, pub recursive: bool,
} }