Merge remote-tracking branch 'origin/develop' into HEAD

This commit is contained in:
Alexandre Paillier
2022-09-14 17:27:25 +02:00
61 changed files with 505 additions and 72 deletions

View File

@@ -17,8 +17,7 @@
#include "shared_context.h"
#include "apdu_constants.h"
#include "ui_callbacks.h"
#include "ui_flow.h"
#include "common_ui.h"
#include "os_io_seproxyhal.h"
@@ -86,24 +85,6 @@ void reset_app_context() {
memset((uint8_t *) &tmpContent, 0, sizeof(tmpContent));
}
void ui_idle(void) {
// reserve a display stack slot if none yet
if (G_ux.stack_count == 0) {
ux_stack_push();
}
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);
return 0; // do not redraw the widget
}
void io_seproxyhal_send_status(uint32_t sw) {
G_io_apdu_buffer[0] = ((sw >> 8) & 0xff);
G_io_apdu_buffer[1] = (sw & 0xff);
@@ -298,6 +279,21 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_ASTAR:
numTokens = NUM_TOKENS_ASTAR;
break;
case CHAIN_KIND_XDCNETWORK:
numTokens = NUM_TOKENS_XDCNETWORK;
break;
case CHAIN_KIND_METER:
numTokens = NUM_TOKENS_METER;
break;
case CHAIN_KIND_MULTIVAC:
numTokens = NUM_TOKENS_MULTIVAC;
break;
case CHAIN_KIND_TECRA:
numTokens = NUM_TOKENS_TECRA;
break;
case CHAIN_KIND_APOTHEMNETWORK:
numTokens = NUM_TOKENS_APOTHEMNETWORK;
break;
}
for (i = 0; i < numTokens; i++) {
switch (chainConfig->kind) {
@@ -436,6 +432,21 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_ASTAR:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_ASTAR[i]);
break;
case CHAIN_KIND_XDCNETWORK:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_XDCNETWORK[i]);
break;
case CHAIN_KIND_METER:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_METER[i]);
break;
case CHAIN_KIND_MULTIVAC:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_MULTIVAC[i]);
break;
case CHAIN_KIND_TECRA:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_TECRA[i]);
break;
case CHAIN_KIND_APOTHEMNETWORK:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_APOTHEMNETWORK[i]);
break;
}
if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) {
return currentToken;