Skip to content

Commit

Permalink
Revert "fix!: don't display sender address as it would crash the app" (
Browse files Browse the repository at this point in the history
…#19)

* Revert "fix!: don't display sender address as it would crash the app"

This reverts commit 2d80148.

* Update test

---------

Co-authored-by: Thibault Martinez <[email protected]>
  • Loading branch information
Thoralf-M and thibault-martinez authored Sep 5, 2024
1 parent 050fdea commit 4a6926d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rust-app/src/implementation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,27 @@ pub async fn sign_apdu(io: HostIO, settings: Settings) {
if scroller("Transfer", |w| Ok(write!(w, "IOTA")?)).is_none() {
reject::<()>(StatusWords::UserCancelled as u16).await;
};
{
let mut bs = input[1].clone();
NoinlineFut(async move {
let path = BIP_PATH_PARSER.parse(&mut bs).await;
if !is_bip_prefix_valid(&path) {
reject::<()>(SyscallError::InvalidParameter as u16).await;
}
if with_public_keys(&path, true, |_, address: &IotaPubKeyAddress| {
try_option(|| -> Option<()> {
scroller_paginated("From", |w| Ok(write!(w, "{address}")?))?;
Some(())
}())
})
.ok()
.is_none()
{
reject::<()>(StatusWords::UserCancelled as u16).await;
}
})
.await
};

{
let mut txn = input[0].clone();
Expand Down
5 changes: 5 additions & 0 deletions ts-tests/signing-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ describe("Signing tests", function () {
"header": "Transfer",
"prompt": "",
},
{
"header": "From",
"prompt": "0x1b3669e321893ee49c387a08fc251dbfff37cd2a981e6c473a5b2afde19d363e",
"paginate": true
},
{
"header": "To",
"prompt": "0x4f2370b2a4810ad6c8e1cfd92cc8c8818fef8f59e3a80cea17871f78d850ba4b",
Expand Down

0 comments on commit 4a6926d

Please sign in to comment.