Skip to content

Commit

Permalink
Remove traces
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Dec 16, 2024
1 parent adff200 commit 2dc1aa7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions src/handlers/common/action/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ pub fn handle(
) -> Result<(), AppSW> {
let transfer = Transfer::deserialize_reader(stream).map_err(|_err| AppSW::TxParsingFail)?;

ledger_device_sdk::testing::debug_print("displaying transfer info\n");

if !sign_ui::action::ui_display_transfer(&transfer, params) {
return Err(AppSW::Deny);
}
Expand Down
11 changes: 1 addition & 10 deletions src/handlers/common/finalize_sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,15 @@ pub fn end(
) -> Result<Signature, AppSW> {
// test no redundant bytes left in stream
let mut buf = [0u8; 1];
ledger_device_sdk::testing::debug_print("finalize signing\n");
match stream.read_exact(&mut buf) {
Err(f) if f.kind() == ErrorKind::UnexpectedEof => { // ok
}
_ => {
return {
ledger_device_sdk::testing::debug_print("finalize signing failed\n");
Err(AppSW::TxParsingFail)
}
}
_ => return Err(AppSW::TxParsingFail),
}

let digest = stream.finalize()?;

let private_key = Ed25519::derive_from_path_slip10(&path.0);

ledger_device_sdk::testing::debug_print("sign Tx \n");

let (sig, _len) = private_key.sign(&digest.0).map_err(|_| AppSW::TxSignFail)?;

Ok(Signature(sig))
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ fn handle_apdu(comm: &mut Comm, ins: Instruction) -> Result<(), AppSW> {
is_last_chunk,
sign_mode,
} => {
ledger_device_sdk::testing::debug_print("handle_apdu => Sign Tx\n");
let stream = SingleTxStream::new(comm, is_last_chunk, sign_mode);
let signature = match sign_mode {
SignMode::Transaction => sign_tx::handler(stream)?,
Expand Down

0 comments on commit 2dc1aa7

Please sign in to comment.