diff --git a/src/subcommands/account/deploy.rs b/src/subcommands/account/deploy.rs index 32f609f..d98f0c3 100644 --- a/src/subcommands/account/deploy.rs +++ b/src/subcommands/account/deploy.rs @@ -275,7 +275,11 @@ impl Deploy { } // TODO: add option to check ETH balance before sending out tx - let account_deployment_tx = account_deployment.send().await?.transaction_hash; + let account_deployment_tx = account_deployment + .send() + .await + .map_err(account_factory_error_mapper)? + .transaction_hash; eprintln!( "Account deployment transaction: {}", format!("{:#064x}", account_deployment_tx).bright_yellow() diff --git a/src/subcommands/declare.rs b/src/subcommands/declare.rs index afe1003..22e5ec3 100644 --- a/src/subcommands/declare.rs +++ b/src/subcommands/declare.rs @@ -182,7 +182,14 @@ impl Declare { return Ok(()); } - (class_hash, declaration.send().await?.transaction_hash) + ( + class_hash, + declaration + .send() + .await + .map_err(account_error_mapper)? + .transaction_hash, + ) } else if let Ok(_) = serde_json::from_reader::<_, CompiledClass>(std::fs::File::open(&self.file)?) { @@ -249,7 +256,14 @@ impl Declare { return Ok(()); } - (class_hash, declaration.send().await?.transaction_hash) + ( + class_hash, + declaration + .send() + .await + .map_err(account_error_mapper)? + .transaction_hash, + ) } else { anyhow::bail!("failed to parse contract artifact"); }; diff --git a/src/subcommands/deploy.rs b/src/subcommands/deploy.rs index 3304e2a..0fb015b 100644 --- a/src/subcommands/deploy.rs +++ b/src/subcommands/deploy.rs @@ -140,7 +140,11 @@ impl Deploy { return Ok(()); } - let deployment_tx = contract_deployment.send().await?.transaction_hash; + let deployment_tx = contract_deployment + .send() + .await + .map_err(account_error_mapper)? + .transaction_hash; eprintln!( "Contract deployment transaction: {}", format!("{:#064x}", deployment_tx).bright_yellow() diff --git a/src/subcommands/invoke.rs b/src/subcommands/invoke.rs index a8f9cda..336136b 100644 --- a/src/subcommands/invoke.rs +++ b/src/subcommands/invoke.rs @@ -144,7 +144,11 @@ impl Invoke { return Ok(()); } - let invoke_tx = execution.send().await?.transaction_hash; + let invoke_tx = execution + .send() + .await + .map_err(account_error_mapper)? + .transaction_hash; eprintln!( "Invoke transaction: {}", format!("{:#064x}", invoke_tx).bright_yellow()