Skip to content

Commit

Permalink
fix: display subwallet id even when blind signing
Browse files Browse the repository at this point in the history
  • Loading branch information
krigga committed Feb 27, 2024
1 parent a610433 commit 9ac7eef
Show file tree
Hide file tree
Showing 40 changed files with 16 additions and 19 deletions.
2 changes: 2 additions & 0 deletions src/transaction/deserialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ parser_status_e transaction_deserialize(buffer_t *buf, transaction_t *tx) {
return TAG_PARSING_ERROR;
}

tx->hints.hints_count = 0;

if (tx->tag == 0x01) {
SAFE(buffer_read_u32(buf, &tx->subwallet_id, BE), GENERAL_ERROR);
SAFE(buffer_read_bool(buf, &tx->include_wallet_op), GENERAL_ERROR);
Expand Down
1 change: 0 additions & 1 deletion src/transaction/transaction_hints.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ bool process_hints(transaction_t* tx) {
BitString_t bits;
bool hasCell = false;
bool tmp = false;
tx->hints.hints_count = 0;
buffer_t buf = {.ptr = tx->hints_data, .size = tx->hints_len, .offset = 0};

//
Expand Down
17 changes: 7 additions & 10 deletions src/ui/display_bagl.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,13 @@ int ui_display_transaction() {
}
ux_approval_flow[step++] = &ux_display_address_step;
ux_approval_flow[step++] = &ux_display_amount_step;
if (G_context.tx_info.transaction.has_payload) {
if (G_context.tx_info.transaction.is_blind) {
ux_approval_flow[step++] = &ux_display_payload_step;
} else {
g_hint_holder = &G_context.tx_info.transaction.hints;
g_hint_offset = -3;
for (uint16_t i = 0; i < G_context.tx_info.transaction.hints.hints_count; i++) {
ux_approval_flow[step++] = &ux_display_hint_step;
}
}
if (G_context.tx_info.transaction.has_payload && G_context.tx_info.transaction.is_blind) {
ux_approval_flow[step++] = &ux_display_payload_step;
}
g_hint_holder = &G_context.tx_info.transaction.hints;
g_hint_offset = -step;
for (uint16_t i = 0; i < G_context.tx_info.transaction.hints.hints_count; i++) {
ux_approval_flow[step++] = &ux_display_hint_step;
}
ux_approval_flow[step++] = &ux_display_approve_step;
ux_approval_flow[step++] = &ux_display_reject_step;
Expand Down
14 changes: 6 additions & 8 deletions src/ui/display_transaction_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,14 @@ static void start_regular_review(void) {
pairs[pairIndex].value = g_address;
pairIndex++;

if (G_context.tx_info.transaction.has_payload) {
if (G_context.tx_info.transaction.is_blind) {
pairs[pairIndex].item = "Payload";
pairs[pairIndex].value = g_payload;
pairIndex++;
} else {
print_hints(&G_context.tx_info.transaction.hints, &pairs[pairIndex]);
}
if (G_context.tx_info.transaction.has_payload && G_context.tx_info.transaction.is_blind) {
pairs[pairIndex].item = "Payload";
pairs[pairIndex].value = g_payload;
pairIndex++;
}

print_hints(&G_context.tx_info.transaction.hints, &pairs[pairIndex]);

pairList.pairs = pairs;
pairList.nbPairs = pairIndex + G_context.tx_info.transaction.hints.hints_count;
pairList.smallCaseForValue = false;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/test_sign_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def test_sign_tx_subwallet_id(firmware, backend, navigator, test_name):

payloads: List[Payload] = [
CommentPayload("test"),
CustomUnsafePayload(Cell()),
]

# Enable blind signing and expert mode
Expand Down

0 comments on commit 9ac7eef

Please sign in to comment.