Add a UI warning when contract data are not enabled in the settings (#193)
* Add a UI warning when contract data are not enabled in the settings * Update wording "contract data" -> "blind signing" to raise awareness * Bump version 1.9.5 * remove hardcoded path in helper build script * Add blind signature test * Add snapshot-tmp to gitignore * Remove unused snapshots * Increase tests timings * Remove unused snapshots * Fix and rename compound blind deposit test * Update Approve and Transfer tests * Update tests * Cosmetic changes + disable debug flag * Update CHANGELOG.md
2
.gitignore
vendored
@@ -15,6 +15,6 @@ tests/node_modules
|
||||
tests/lib
|
||||
tests/yarn-error.log
|
||||
tests/elfs/*
|
||||
tests/snapshots/tmp/*
|
||||
tests/snapshots-tmp
|
||||
|
||||
.vscode
|
||||
|
||||
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [1.9.5](https://github.com/ledgerhq/app-ethereum/compare/1.9.4...1.9.5) - 2021-9-27
|
||||
|
||||
### Changed
|
||||
|
||||
- "Contract Data" is now replaced with "Blind sign", which carries more meaning for regular users.
|
||||
|
||||
### Added
|
||||
|
||||
- When blind signing is disabled in settings, and a transaction with smart conract interactions is sent to the app, a new warning screen pops to let the user know that the setting must be enabled to sign this kind of transactions.
|
||||
|
||||
## [1.9.4](https://github.com/ledgerhq/app-ethereum/compare/1.9.3...1.9.4) - 2021-9-14
|
||||
|
||||
|
||||
2
Makefile
@@ -30,7 +30,7 @@ APP_LOAD_PARAMS += --path "1517992542'/1101353413'"
|
||||
|
||||
APPVERSION_M=1
|
||||
APPVERSION_N=9
|
||||
APPVERSION_P=4
|
||||
APPVERSION_P=5
|
||||
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
|
||||
APP_LOAD_FLAGS= --appFlags 0x240 --dep Ethereum:$(APPVERSION)
|
||||
|
||||
|
||||
@@ -92,6 +92,10 @@ void ui_idle(void) {
|
||||
ux_flow_init(0, ux_idle_flow, NULL);
|
||||
}
|
||||
|
||||
void ui_warning_contract_data(void) {
|
||||
ux_flow_init(0, ux_warning_contract_data_flow, NULL);
|
||||
}
|
||||
|
||||
unsigned int io_seproxyhal_touch_exit(__attribute__((unused)) const bagl_element_t *e) {
|
||||
// Go back to the dashboard
|
||||
os_sched_exit(0);
|
||||
|
||||
@@ -16,6 +16,7 @@ unsigned int io_seproxyhal_touch_signMessage712_v0_cancel(const bagl_element_t *
|
||||
unsigned int io_seproxyhal_touch_eth2_address_ok(const bagl_element_t *e);
|
||||
|
||||
void ui_idle(void);
|
||||
void ui_warning_contract_data(void);
|
||||
|
||||
void io_seproxyhal_send_status(uint32_t sw);
|
||||
void format_signature_out(const uint8_t *signature);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
void display_settings(const ux_flow_step_t* const start_step);
|
||||
void switch_settings_contract_data(void);
|
||||
void switch_settings_blind_signing(void);
|
||||
void switch_settings_display_data(void);
|
||||
void switch_settings_display_nonce(void);
|
||||
|
||||
@@ -54,9 +54,9 @@ UX_FLOW(ux_idle_flow,
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_1_step,
|
||||
bnnn_paging,
|
||||
switch_settings_contract_data(),
|
||||
switch_settings_blind_signing(),
|
||||
{
|
||||
.title = "Contract data",
|
||||
.title = "Blind signing",
|
||||
.text = strings.common.fullAddress,
|
||||
});
|
||||
|
||||
@@ -83,11 +83,11 @@ UX_STEP_CB(
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_1_step,
|
||||
bnnn,
|
||||
switch_settings_contract_data(),
|
||||
switch_settings_blind_signing(),
|
||||
{
|
||||
"Contract data",
|
||||
"Allow contract data",
|
||||
"in transactions",
|
||||
"Blind signing",
|
||||
"Enable transaction",
|
||||
"blind signing",
|
||||
strings.common.fullAddress,
|
||||
});
|
||||
|
||||
@@ -132,7 +132,7 @@ UX_FLOW(ux_settings_flow,
|
||||
&ux_settings_flow_4_step);
|
||||
|
||||
void display_settings(const ux_flow_step_t* const start_step) {
|
||||
strlcpy(strings.common.fullAddress, (N_storage.dataAllowed ? "Allowed" : "NOT Allowed"), 12);
|
||||
strlcpy(strings.common.fullAddress, (N_storage.dataAllowed ? "Enabled" : "NOT Enabled"), 12);
|
||||
strlcpy(strings.common.fullAddress + 12,
|
||||
(N_storage.contractDetails ? "Displayed" : "NOT Displayed"),
|
||||
26 - 12);
|
||||
@@ -142,7 +142,7 @@ void display_settings(const ux_flow_step_t* const start_step) {
|
||||
ux_flow_init(0, ux_settings_flow, start_step);
|
||||
}
|
||||
|
||||
void switch_settings_contract_data() {
|
||||
void switch_settings_blind_signing() {
|
||||
uint8_t value = (N_storage.dataAllowed ? 0 : 1);
|
||||
nvm_write((void*) &N_storage.dataAllowed, (void*) &value, sizeof(uint8_t));
|
||||
display_settings(&ux_settings_flow_1_step);
|
||||
@@ -159,3 +159,29 @@ void switch_settings_display_nonce() {
|
||||
nvm_write((void*) &N_storage.displayNonce, (void*) &value, sizeof(uint8_t));
|
||||
display_settings(&ux_settings_flow_3_step);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// clang-format off
|
||||
#if defined(TARGET_NANOS)
|
||||
UX_STEP_CB(
|
||||
ux_warning_contract_data_step,
|
||||
bnnn_paging,
|
||||
ui_idle(),
|
||||
{
|
||||
"Error",
|
||||
"Blind signing must be enabled in Settings",
|
||||
});
|
||||
#elif defined(TARGET_NANOX)
|
||||
UX_STEP_CB(
|
||||
ux_warning_contract_data_step,
|
||||
pnn,
|
||||
ui_idle(),
|
||||
{
|
||||
&C_icon_crossmark,
|
||||
"Blind signing must be",
|
||||
"enabled in Settings",
|
||||
});
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
UX_FLOW(ux_warning_contract_data_flow, &ux_warning_contract_data_step);
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
extern const ux_flow_step_t* const ux_idle_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_warning_contract_data_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_settings_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_display_public_flow[];
|
||||
|
||||
@@ -81,6 +81,7 @@ customStatus_e customProcessor(txContext_t *context) {
|
||||
if (fieldPos == 0) { // not reached if a plugin is available
|
||||
if (!N_storage.dataAllowed) {
|
||||
PRINTF("Data field forbidden\n");
|
||||
ui_warning_contract_data();
|
||||
return CUSTOM_FAULT;
|
||||
}
|
||||
if (!N_storage.contractDetails) {
|
||||
@@ -407,6 +408,7 @@ void finalizeParsing(bool direct) {
|
||||
|
||||
if (tmpContent.txContent.dataPresent && !N_storage.dataAllowed) {
|
||||
reportFinalizeError(direct);
|
||||
ui_warning_contract_data();
|
||||
if (!direct) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -187,12 +187,12 @@ UX_STEP_NOCB(
|
||||
.text = strings.common.nonce,
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_approval_data_warning_step,
|
||||
UX_STEP_NOCB(ux_approval_blind_signing_warning_step,
|
||||
pbb,
|
||||
{
|
||||
&C_icon_warning,
|
||||
"Data",
|
||||
"Present",
|
||||
"Blind",
|
||||
"Signing",
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
@@ -203,7 +203,7 @@ void ux_approve_tx(bool fromPlugin) {
|
||||
ux_approval_tx_flow[step++] = &ux_approval_review_step;
|
||||
|
||||
if (!fromPlugin && tmpContent.txContent.dataPresent && !N_storage.contractDetails) {
|
||||
ux_approval_tx_flow[step++] = &ux_approval_data_warning_step;
|
||||
ux_approval_tx_flow[step++] = &ux_approval_blind_signing_warning_step;
|
||||
}
|
||||
|
||||
if (fromPlugin) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# FILL THESE WITH YOUR OWN SDKs PATHS
|
||||
NANOS_SDK=$TWO
|
||||
NANOX_SDK=$X
|
||||
# NANOS_SDK=
|
||||
# NANOX_SDK=
|
||||
|
||||
# list of apps required by tests that we want to build here
|
||||
appnames=("ethereum" "ethereum_classic")
|
||||
|
||||
|
Before Width: | Height: | Size: 518 B |
|
Before Width: | Height: | Size: 600 B |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
|
Before Width: | Height: | Size: 455 B After Width: | Height: | Size: 455 B |
|
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |
|
Before Width: | Height: | Size: 790 B After Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 824 B After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 602 B After Width: | Height: | Size: 602 B |
|
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
BIN
tests/snapshots/nanos_approve_dai_tokens/00008.png
Normal file
|
After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
BIN
tests/snapshots/nanos_deposit_eth_compound_blind/00001.png
Normal file
|
After Width: | Height: | Size: 503 B |
|
Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 431 B |
|
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 772 B |
|
Before Width: | Height: | Size: 813 B After Width: | Height: | Size: 813 B |
|
Before Width: | Height: | Size: 590 B After Width: | Height: | Size: 590 B |
|
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 619 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
BIN
tests/snapshots/nanos_deposit_eth_compound_blind/00008.png
Normal file
|
After Width: | Height: | Size: 531 B |
BIN
tests/snapshots/nanos_disable_blind_signing/00000.png
Normal file
|
After Width: | Height: | Size: 531 B |
BIN
tests/snapshots/nanos_disable_blind_signing/00001.png
Normal file
|
After Width: | Height: | Size: 446 B |
BIN
tests/snapshots/nanos_disable_blind_signing/00002.png
Normal file
|
After Width: | Height: | Size: 480 B |
BIN
tests/snapshots/nanos_disable_blind_signing/00003.png
Normal file
|
After Width: | Height: | Size: 514 B |
BIN
tests/snapshots/nanos_disable_blind_signing/00004.png
Normal file
|
After Width: | Height: | Size: 566 B |
BIN
tests/snapshots/nanos_disable_blind_signing/00005.png
Normal file
|
After Width: | Height: | Size: 614 B |
BIN
tests/snapshots/nanos_disable_blind_signing/00006.png
Normal file
|
After Width: | Height: | Size: 628 B |
BIN
tests/snapshots/nanos_disable_blind_signing/00007.png
Normal file
|
After Width: | Height: | Size: 338 B |
BIN
tests/snapshots/nanos_disable_blind_signing/00008.png
Normal file
|
After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
|
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 759 B |
|
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 809 B After Width: | Height: | Size: 809 B |
|
Before Width: | Height: | Size: 837 B After Width: | Height: | Size: 837 B |
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
|
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 628 B |
|
Before Width: | Height: | Size: 561 B After Width: | Height: | Size: 561 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
BIN
tests/snapshots/nanos_transfer_112233445566_network/00010.png
Normal file
|
After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
|
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 499 B |
|
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 759 B |
|
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 809 B After Width: | Height: | Size: 809 B |
|
Before Width: | Height: | Size: 837 B After Width: | Height: | Size: 837 B |
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 449 B |
|
Before Width: | Height: | Size: 569 B After Width: | Height: | Size: 569 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
BIN
tests/snapshots/nanos_transfer_bsc/00010.png
Normal file
|
After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
|
Before Width: | Height: | Size: 414 B After Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 724 B After Width: | Height: | Size: 724 B |
|
Before Width: | Height: | Size: 727 B After Width: | Height: | Size: 727 B |
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
|
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 536 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
BIN
tests/snapshots/nanos_transfer_eip1559/00007.png
Normal file
|
After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
|
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 759 B |
|
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 809 B After Width: | Height: | Size: 809 B |
|
Before Width: | Height: | Size: 837 B After Width: | Height: | Size: 837 B |
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
|
Before Width: | Height: | Size: 561 B After Width: | Height: | Size: 561 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
BIN
tests/snapshots/nanos_transfer_ethereum/00009.png
Normal file
|
After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
BIN
tests/snapshots/nanos_transfer_ethereum_5234_network/00001.png
Normal file
|
After Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 759 B |
|
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 809 B After Width: | Height: | Size: 809 B |
|
Before Width: | Height: | Size: 837 B After Width: | Height: | Size: 837 B |
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
|
Before Width: | Height: | Size: 477 B After Width: | Height: | Size: 477 B |
BIN
tests/snapshots/nanos_transfer_ethereum_5234_network/00008.png
Normal file
|
After Width: | Height: | Size: 561 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 582 B |
BIN
tests/snapshots/nanos_transfer_ethereum_5234_network/00010.png
Normal file
|
After Width: | Height: | Size: 531 B |
BIN
tests/snapshots/nanos_transfer_ethereum_clone/00000.png
Normal file
|
After Width: | Height: | Size: 541 B |
|
Before Width: | Height: | Size: 475 B After Width: | Height: | Size: 475 B |
BIN
tests/snapshots/nanos_transfer_ethereum_clone/00002.png
Normal file
|
After Width: | Height: | Size: 759 B |
BIN
tests/snapshots/nanos_transfer_ethereum_clone/00003.png
Normal file
|
After Width: | Height: | Size: 479 B |
BIN
tests/snapshots/nanos_transfer_ethereum_clone/00004.png
Normal file
|
After Width: | Height: | Size: 809 B |
BIN
tests/snapshots/nanos_transfer_ethereum_clone/00005.png
Normal file
|
After Width: | Height: | Size: 837 B |
BIN
tests/snapshots/nanos_transfer_ethereum_clone/00006.png
Normal file
|
After Width: | Height: | Size: 567 B |
|
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 557 B |
BIN
tests/snapshots/nanos_transfer_ethereum_clone/00008.png
Normal file
|
After Width: | Height: | Size: 582 B |
BIN
tests/snapshots/nanos_transfer_ethereum_clone/00009.png
Normal file
|
After Width: | Height: | Size: 531 B |