Skip to content

Commit

Permalink
Update logs
Browse files Browse the repository at this point in the history
  • Loading branch information
raychu86 committed Feb 21, 2023
1 parent eaf0752 commit c463002
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cli/src/commands/developer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,16 @@ impl Developer {
transaction: Transaction<CurrentNetwork>,
operation: String,
) -> Result<String> {
// Get the transaction id.
let transaction_id = transaction.id();

// Determine if the transaction should be stored.
if let Some(path) = store {
match PathBuf::from_str(&path) {
Ok(file_path) => {
let transaction_bytes = transaction.to_bytes_le()?;
std::fs::write(file_path, transaction_bytes)?;
std::fs::write(&file_path, transaction_bytes)?;
println!("Transaction {transaction_id} was stored to {}", file_path.display());
}
Err(err) => {
println!("The transaction was unable to be stored due to: {err}");
Expand All @@ -139,9 +143,6 @@ impl Developer {

// Determine if the transaction should be broadcast or displayed to user.
if let Some(endpoint) = broadcast {
// Get the transaction id.
let transaction_id = transaction.id();

// Send the deployment request to the local development node.
match ureq::post(&endpoint).send_json(&transaction) {
Ok(id) => {
Expand Down

0 comments on commit c463002

Please sign in to comment.