Skip to content

Commit

Permalink
Merge pull request #2 from MCN-ING/fix
Browse files Browse the repository at this point in the history
println in debug mode only
  • Loading branch information
SylvainMartel authored Apr 23, 2024
2 parents a27dae1 + 8639466 commit 4d2545c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 34 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/typos.yml

This file was deleted.

18 changes: 12 additions & 6 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,25 @@ pub async fn register_nym(
sign_nym_request(&mut nym_request, trustee)?;

// Submit the signed request to the ledger
println!(
"Submitting NYM request: {:?}",
nym_request.req_json.to_string()
);
if cfg!(debug_assertions) {
println!(
"Submitting NYM request: {:?}",
nym_request.req_json.to_string()
);
}
let (request_result, _) = perform_ledger_request(pool, &nym_request, None).await?;

match request_result {
RequestResult::Reply(message) => {
println!("Reply: {:?}", message);
if cfg!(debug_assertions) {
println!("Reply: {:?}", message);
}
Ok(message)
}
RequestResult::Failed(error) => {
println!("Error: {:?}", error);
if cfg!(debug_assertions) {
println!("Error: {:?}", error);
}
Err(error)
}
}
Expand Down
10 changes: 1 addition & 9 deletions src/indorser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn endorser_tool(
match signed_txn {
Ok(txn) => {
let unescaped_json = serde_json::to_string(&txn).unwrap();
*signed_txn_result = Some(format!("{}", unescaped_json.clone()));
*signed_txn_result = Some(unescaped_json.clone().to_string());
}
Err(e) => {
*signed_txn_result = Some(format!("Error: {:?}", e));
Expand Down Expand Up @@ -73,15 +73,7 @@ pub fn endorser_tool(
// }
ui.separator();
ui.with_layout(egui::Layout::bottom_up(egui::Align::LEFT), |ui| {
powered_by_candy(ui);
egui::warn_if_debug_build(ui);
});
}
}

fn powered_by_candy(ui: &mut egui::Ui) {
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 0.0;
ui.label("CANdy tooling");
});
}

0 comments on commit 4d2545c

Please sign in to comment.