Skip to content

Commit 49106c2

Browse files
Merge branch 'Blockstream:master' into feature_export_xpub
2 parents b0aab07 + 944b32e commit 49106c2

File tree

5 files changed

+31
-19
lines changed

5 files changed

+31
-19
lines changed

main/fonts/jade_symbols_16x16.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef AMALGAMATED_BUILD
2-
const unsigned char jade_symbols_16x16[4 + 32 * 31] = {
2+
const unsigned char jade_symbols_16x16[4 + 32 * 32] = {
33
0x10, 0x10, 0x30, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFC, 0xC0, 0x0F, 0xC0,
44
0x0F, 0xC0, 0x0F, 0xC0, 0x0F, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
55
0x00, // 0 Battery empty
@@ -63,5 +63,7 @@ const unsigned char jade_symbols_16x16[4 + 32 * 31] = {
6363
0x0C, 0x18, 0x18, 0x5C, 0x38, 0x0F, 0xF0, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, // M Hollow Circle
6464
0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x0F, 0xF0, 0x1C, 0x38, 0x19, 0x98, 0x31, 0x8C, 0x37, 0x8C, 0x37, 0x8C, 0x30,
6565
0x0C, 0x18, 0x18, 0x5C, 0x38, 0x0F, 0xF0, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, // N Clock
66+
0x7F, 0xFE, 0x40, 0x02, 0x5F, 0xE2, 0x5F, 0xF2, 0x58, 0x1A, 0x58, 0x1A, 0x58, 0x1A, 0x5F, 0xF2, 0x5F, 0xE2, 0x59,
67+
0xC2, 0x58, 0xE2, 0x58, 0x72, 0x58, 0x3A, 0x58, 0x1A, 0x40, 0x02, 0x7F, 0xFE, // O Japan Cert "R"
6668
};
6769
#endif // AMALGAMATED_BUILD

main/process/sign_psbt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include "process_utils.h"
2929

3030
bool show_btc_transaction_outputs_activity(
31-
const network_t network_id, const struct wally_tx* tx, const output_info_t* output_info);
32-
bool show_btc_fee_confirmation_activity(const struct wally_tx* tx, const output_info_t* outinfo,
31+
network_t network_id, const struct wally_tx* tx, const output_info_t* output_info);
32+
bool show_btc_fee_confirmation_activity(network_t network_id, const struct wally_tx* tx, const output_info_t* outinfo,
3333
script_flavour_t aggregate_inputs_scripts_flavour, uint64_t input_amount, uint64_t output_amount);
3434

3535
// From https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki
@@ -810,7 +810,7 @@ int sign_psbt(const network_t network_id, struct wally_psbt* psbt, const char**
810810
// User to agree fee amount
811811
// Check to see whether user accepted or declined
812812
if (!show_btc_fee_confirmation_activity(
813-
tx, output_info, aggregate_inputs_scripts_flavour, input_amount, output_amount)) {
813+
network_id, tx, output_info, aggregate_inputs_scripts_flavour, input_amount, output_amount)) {
814814
*errmsg = "User declined to sign psbt";
815815
retval = CBOR_RPC_USER_CANCELLED;
816816
goto cleanup;

main/process/sign_tx.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ bool show_elements_swap_activity(const network_t network_id, bool initial_propos
4747
size_t num_in_sums, const asset_summary_t* out_sums, size_t num_out_sums, const asset_info_t* assets,
4848
size_t num_assets);
4949

50-
bool show_btc_final_confirmation_activity(uint64_t fee, const char* warning_msg);
50+
bool show_btc_final_confirmation_activity(network_t network_id, uint64_t fee, const char* warning_msg);
5151
bool show_elements_final_confirmation_activity(
5252
const network_t network_id, const char* title, const uint64_t fee, const char* warning_msg);
5353

@@ -365,8 +365,9 @@ bool rpc_get_signing_outputs(jade_process_t* process, const CborValue* params, c
365365
return true;
366366
}
367367

368-
bool show_btc_fee_confirmation_activity(const struct wally_tx* tx, const output_info_t* outinfo,
369-
const script_flavour_t aggregate_inputs_scripts_flavour, const uint64_t input_amount, const uint64_t output_amount)
368+
bool show_btc_fee_confirmation_activity(const network_t network_id, const struct wally_tx* tx,
369+
const output_info_t* outinfo, const script_flavour_t aggregate_inputs_scripts_flavour, const uint64_t input_amount,
370+
const uint64_t output_amount)
370371
{
371372
JADE_ASSERT(tx);
372373
// outputinfo is optional
@@ -405,7 +406,7 @@ bool show_btc_fee_confirmation_activity(const struct wally_tx* tx, const output_
405406
}
406407

407408
// Return whether the user accepts or declines
408-
return show_btc_final_confirmation_activity(fees, warning_msg);
409+
return show_btc_final_confirmation_activity(network_id, fees, warning_msg);
409410
}
410411

411412
// Loop to generate and send Anti-Exfil signatures as they are requested.
@@ -602,7 +603,7 @@ static void sign_tx_impl(jade_process_t* process, const bool for_liquid)
602603
}
603604
} else {
604605
// Bitcoin: Confirm all non-change outputs
605-
if (for_liquid && !show_btc_transaction_outputs_activity(network_id, tx, output_info)) {
606+
if (!show_btc_transaction_outputs_activity(network_id, tx, output_info)) {
606607
cancelmsg = "User declined to sign transaction";
607608
}
608609
}
@@ -934,7 +935,7 @@ static void sign_tx_impl(jade_process_t* process, const bool for_liquid)
934935
// User to agree fee amount
935936
// If user cancels we'll send the 'cancelled' error response for the last input message only
936937
if (!show_btc_fee_confirmation_activity(
937-
tx, output_info, aggregate_inputs_scripts_flavour, input_amount, output_amount)) {
938+
network_id, tx, output_info, aggregate_inputs_scripts_flavour, input_amount, output_amount)) {
938939
// If using ae-signatures, we need to load the message to send the error back on
939940
if (use_ae_signatures) {
940941
jade_process_load_in_message(process, true);

main/ui/dashboard.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -752,18 +752,25 @@ static void make_legal_page(link_activity_t* page_act, int legal_page)
752752
}
753753
#if defined(CONFIG_BOARD_TYPE_JADE_V1_1) || defined(CONFIG_BOARD_TYPE_JADE_V2)
754754
case 6: {
755-
gui_view_node_t* vsplit;
756-
gui_make_vsplit(&vsplit, GUI_SPLIT_RELATIVE, 2, 80, 20);
757-
gui_set_parent(vsplit, parent);
755+
gui_view_node_t* hsplit;
756+
gui_make_hsplit(&hsplit, GUI_SPLIT_RELATIVE, 3, 36, 10, 54);
757+
gui_set_parent(hsplit, parent);
758758

759759
Picture* const pic = get_picture(telecstart, telecend);
760760
gui_make_picture(&node, pic);
761-
gui_set_parent(node, vsplit);
762-
gui_set_align(node, GUI_ALIGN_CENTER, GUI_ALIGN_MIDDLE);
761+
gui_set_parent(node, hsplit);
762+
gui_set_align(node, GUI_ALIGN_RIGHT, GUI_ALIGN_MIDDLE);
763+
gui_set_padding(node, GUI_MARGIN_ALL_DIFFERENT, 0, 8, 0, 0);
764+
765+
gui_make_text_font(&node, "O", TFT_WHITE, JADE_SYMBOLS_16x16_FONT);
766+
gui_set_parent(node, hsplit);
767+
gui_set_align(node, GUI_ALIGN_RIGHT, GUI_ALIGN_MIDDLE);
768+
gui_set_padding(node, GUI_MARGIN_ALL_DIFFERENT, 0, 4, 2, 0);
763769

764770
gui_make_text(&node, "211-210802", TFT_WHITE);
765-
gui_set_parent(node, vsplit);
766-
gui_set_align(node, GUI_ALIGN_CENTER, GUI_ALIGN_MIDDLE);
771+
gui_set_parent(node, hsplit);
772+
gui_set_align(node, GUI_ALIGN_LEFT, GUI_ALIGN_MIDDLE);
773+
gui_set_padding(node, GUI_MARGIN_ALL_DIFFERENT, 0, 0, 0, 4);
767774
break;
768775
}
769776
#endif

main/ui/sign_tx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static bool show_input_output_activity(const char* title, const bool is_wallet_o
417417
bool show_btc_transaction_outputs_activity(
418418
const network_t network_id, const struct wally_tx* tx, const output_info_t* output_info)
419419
{
420-
JADE_ASSERT(network_id != NETWORK_NONE);
420+
JADE_ASSERT(!network_is_liquid(network_id));
421421
JADE_ASSERT(tx);
422422
// Note: output_info is optional and can be null
423423

@@ -763,8 +763,10 @@ static bool show_final_confirmation_activity(
763763
}
764764
}
765765

766-
bool show_btc_final_confirmation_activity(const uint64_t fee, const char* warning_msg)
766+
bool show_btc_final_confirmation_activity(const network_t network_id, const uint64_t fee, const char* warning_msg)
767767
{
768+
JADE_ASSERT(!network_is_liquid(network_id));
769+
768770
char feeamount[32];
769771
const int ret = snprintf(feeamount, sizeof(feeamount), "%.08f", 1.0 * fee / 1e8);
770772
JADE_ASSERT(ret > 0 && ret < sizeof(feeamount));

0 commit comments

Comments
 (0)