Skip to content

Commit

Permalink
Show bip32 path on da ui
Browse files Browse the repository at this point in the history
  • Loading branch information
steel97 committed Oct 17, 2024
1 parent e84fade commit 7f336f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/commands/deriveaddress/da_ui_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,28 @@ int ui_display_address(derive_address_ctx_t* ctx,
pair_list.nbPairs = n_pairs;
pair_list.pairs = pairs_global;

if (!ui_bip32_path_screen(bip32_path,
bip32_path_len,
ctx->bip32_path,
MEMBER_SIZE(derive_address_ctx_t, bip32_path))) {
return res_error(SW_BIP32_BAD_PATH);
}

if (send) {
// Confirm Send Address
nbgl_useCaseAddressReview(ctx->address,
n_pairs == 0 ? NULL : &pair_list,
&WHEEL_ICON,
"Confirm Send Address",
"",
ctx->bip32_path,
ui_display_address_confirm);
} else {
// Confirm Address
nbgl_useCaseAddressReview(ctx->address,
n_pairs == 0 ? NULL : &pair_list,
&INFO_I_ICON,
"Confirm Address",
"",
ctx->bip32_path,
ui_display_address_confirm);
}

Expand Down
7 changes: 4 additions & 3 deletions src/commands/extpubkey/epk_ui_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ int ui_display_account(extended_public_key_ctx_t* ctx,
return res_error(SW_BIP32_BAD_PATH);
}

uint path_size = MEMBER_SIZE(extended_public_key_ctx_t, bip32_path);
memset(ctx->bip32_path, 0, path_size);
if (!bip32_path_format(bip32_path, bip32_path_len, ctx->bip32_path, path_size)) {
if (!ui_bip32_path_screen(bip32_path,
bip32_path_len,
ctx->bip32_path,
MEMBER_SIZE(derive_address_ctx_t, bip32_path))) {
return res_error(SW_BIP32_BAD_PATH);
}

Expand Down

0 comments on commit 7f336f5

Please sign in to comment.