Skip to content

Commit

Permalink
fix(legacy): fix OK-25083 & OK-25088 (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyxyx authored Dec 22, 2023
1 parent a516200 commit 8a5b950
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
5 changes: 2 additions & 3 deletions legacy/firmware/fsm_msg_nostr.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ void fsm_msgNostrGetPublicKey(const NostrGetPublicKey *msg) {

if (msg->has_show_display && msg->show_display) {
char desc[32] = {0};
strcat(desc, "Nostr");
strcat(desc, " ");
strcat(desc, _("Address:"));
strcat(desc, "Nostr ");
strcat(desc, _("Public Key"));
if (!fsm_layoutAddress(resp->npub, NULL, desc, false, 0, msg->address_n,
msg->address_n_count, true, NULL, 0, 0, NULL)) {
return;
Expand Down
3 changes: 2 additions & 1 deletion legacy/firmware/language.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,8 @@ const char *languages[][2] = {
{"Propose", "投票"},
{"Proposer", "提案申请人"},
// lisk.c
{"Public Key:", "公钥"},
{"Public Key", "公钥"},
{"Public Key:", "公钥:"},
// layout2.c
{"QR Code", "二维码"},
//
Expand Down
6 changes: 5 additions & 1 deletion legacy/firmware/layout2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,11 @@ uint8_t layoutAddress(const char *address, const char *address_type,
if (address_type) {
oledDrawStringAdapter(0, 13, address_type, FONT_STANDARD);
} else {
oledDrawStringAdapter(0, 13, _("Address:"), FONT_STANDARD);
if (address && (memcmp(address, "npub", 4) == 0)) {
oledDrawStringAdapter(0, 13, _("Public Key:"), FONT_STANDARD);
} else {
oledDrawStringAdapter(0, 13, _("Address:"), FONT_STANDARD);
}
}
oledDrawStringAdapter(0, 13 + 1 * 10, str[0], FONT_STANDARD);
oledDrawStringAdapter(0, 13 + 2 * 10, str[1], FONT_STANDARD);
Expand Down
15 changes: 15 additions & 0 deletions legacy/firmware/polkadot/substrate/substrate_dispatch_V18.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,11 @@ const char* _getMethod_Name_V18(uint8_t moduleIdx, uint8_t callIdx) {

switch (callPrivIdx) {
case 1280: /* module 5 call 0 */
case 1287:
case 1024:
case 1031:
case 7936:
case 7943:
return STR_ME_TRANSFER;
case 1282: /* module 5 call 2 */
case 1026:
Expand Down Expand Up @@ -266,8 +269,11 @@ uint8_t _getMethod_NumItems_V18(uint8_t moduleIdx, uint8_t callIdx) {

switch (callPrivIdx) {
case 1280: /* module 5 call 0 */
case 1287:
case 1024:
case 1031:
case 7936:
case 7943:
return 2;
case 1282: /* module 5 call 2 */
case 1026:
Expand All @@ -294,8 +300,11 @@ const char* _getMethod_ItemName_V18(uint8_t moduleIdx, uint8_t callIdx,

switch (callPrivIdx) {
case 1280: /* module 5 call 0 */
case 1287:
case 1024:
case 1031:
case 7936:
case 7943:
switch (itemIdx) {
case 0:
return STR_IT_amount;
Expand Down Expand Up @@ -354,8 +363,11 @@ parser_error_t _getMethod_ItemValue_V18(pd_Method_V18_t* m, uint8_t moduleIdx,

switch (callPrivIdx) {
case 1280: /* module 5 call 0 */
case 1287: /* module 5 call 0 */
case 1024: /* module 5 call 0 */
case 1031: /* module 5 call 0 */
case 7936: /* module 5 call 0 */
case 7943:
switch (itemIdx) {
case 0: /* balances_transfer_V18 - amount */;
return _toStringCompactBalance(
Expand Down Expand Up @@ -439,8 +451,11 @@ bool _getMethod_IsNestingSupported_V18(uint8_t moduleIdx, uint8_t callIdx) {

switch (callPrivIdx) { // Balances & BlindSign
case 1280: /* module 5 call 0 */
case 1287: /* module 5 call 0 */
case 1024: /* module 5 call 0 */
case 1031: /* module 5 call 0 */
case 7936: /* module 5 call 0 */
case 7943:
case 1282:
case 1026:
case 7938:
Expand Down

0 comments on commit 8a5b950

Please sign in to comment.