mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 14:28:07 +00:00
refactor(legacy): Factor out fsm_layoutPathWarning().
This commit is contained in:
parent
1b9e575d3e
commit
054ab48689
@ -370,6 +370,18 @@ void fsm_msgRebootToBootloader(void) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool fsm_layoutPathWarning(void) {
|
||||||
|
layoutDialogSwipe(&bmp_icon_warning, _("Abort"), _("Continue"), NULL,
|
||||||
|
_("Wrong address path"), _("for selected coin."), NULL,
|
||||||
|
_("Continue at your"), _("own risk!"), NULL);
|
||||||
|
if (!protectButton(ButtonRequestType_ButtonRequest_UnknownDerivationPath,
|
||||||
|
false)) {
|
||||||
|
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#include "fsm_msg_coin.h"
|
#include "fsm_msg_coin.h"
|
||||||
#include "fsm_msg_common.h"
|
#include "fsm_msg_common.h"
|
||||||
#include "fsm_msg_crypto.h"
|
#include "fsm_msg_crypto.h"
|
||||||
|
@ -143,4 +143,6 @@ void fsm_msgRebootToBootloader(void);
|
|||||||
bool fsm_layoutSignMessage(const uint8_t *msg, uint32_t len);
|
bool fsm_layoutSignMessage(const uint8_t *msg, uint32_t len);
|
||||||
bool fsm_layoutVerifyMessage(const uint8_t *msg, uint32_t len);
|
bool fsm_layoutVerifyMessage(const uint8_t *msg, uint32_t len);
|
||||||
|
|
||||||
|
bool fsm_layoutPathWarning(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -164,12 +164,7 @@ static bool fsm_checkCoinPath(const CoinInfo *coin, InputScriptType script_type,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
layoutDialogSwipe(&bmp_icon_warning, _("Abort"), _("Continue"), NULL,
|
if (!fsm_layoutPathWarning()) {
|
||||||
_("Wrong address path"), _("for selected coin."), NULL,
|
|
||||||
_("Continue at your"), _("own risk!"), NULL);
|
|
||||||
if (!protectButton(ButtonRequestType_ButtonRequest_UnknownDerivationPath,
|
|
||||||
false)) {
|
|
||||||
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
|
||||||
layoutHome();
|
layoutHome();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -763,12 +763,7 @@ static bool derive_node(TxInputType *tinput) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
layoutDialogSwipe(&bmp_icon_warning, _("Abort"), _("Continue"), NULL,
|
if (!fsm_layoutPathWarning()) {
|
||||||
_("Wrong address path"), _("for selected coin."), NULL,
|
|
||||||
_("Continue at your"), _("own risk!"), NULL);
|
|
||||||
if (!protectButton(ButtonRequestType_ButtonRequest_UnknownDerivationPath,
|
|
||||||
false)) {
|
|
||||||
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
|
||||||
signing_abort();
|
signing_abort();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user