diff --git a/app/Makefile.version b/app/Makefile.version index 6862e02..38388f1 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=2 # This is the `spec_version` field of `Runtime` APPVERSION_N=4 # This is the patch version of this release -APPVERSION_P=1 +APPVERSION_P=2 diff --git a/app/src/coin.h b/app/src/coin.h index 1855716..550817f 100644 --- a/app/src/coin.h +++ b/app/src/coin.h @@ -53,8 +53,6 @@ typedef enum { #define APPVERSION_LINE1 "Version:" #define APPVERSION_LINE2 ("v" APPVERSION) -#define COIN_DEFAULT_CHAINID "thorchain" - #define COIN_DEFAULT_DENOM_BASE "rune" #define COIN_DEFAULT_DENOM_REPR "RUNE" #define COIN_DEFAULT_DENOM_REPR_2 "THOR.RUNE" @@ -80,6 +78,13 @@ typedef enum { #define INS_SIGN_SECP256K1 0x02u #define INS_GET_ADDR_SECP256K1 0x04u +#define SUPPORTED_CHAIN_COUNT 3 +static const char* const SUPPORTED_CHAIN_IDS[SUPPORTED_CHAIN_COUNT] = { + "thorchain", + "thorchain-1", + "thorchain-stagenet-2" +}; + #ifdef __cplusplus } #endif diff --git a/app/src/tx_display.c b/app/src/tx_display.c index 1b5e6d5..2c2c150 100644 --- a/app/src/tx_display.c +++ b/app/src/tx_display.c @@ -123,19 +123,21 @@ __Z_INLINE parser_error_t calculate_is_default_chainid() { 0, &pageCount)) zemu_log_stack(outVal); - zemu_log_stack(COIN_DEFAULT_CHAINID); - if (strcmp(outVal, COIN_DEFAULT_CHAINID) == 0) { - // If we don't match the default chainid, switch to expert mode - display_cache.is_default_chain = true; - zemu_log_stack("DEFAULT Chain "); - } else if ((outVal[0] == 0x30 || outVal[0] == 0x31) && strlen(outVal) == 1) { + // Check if chain ID matches any of the supported ones + for (uint8_t i = 0; i < SUPPORTED_CHAIN_COUNT; i++) { + if (strcmp(outVal, SUPPORTED_CHAIN_IDS[i]) == 0) { + display_cache.is_default_chain = true; + zemu_log_stack("Supported Chain"); + return parser_ok; + } + } + if ((outVal[0] == 0x30 || outVal[0] == 0x31) && strlen(outVal) == 1) { zemu_log_stack("Not Allowed chain"); return parser_unexpected_chain; - } else { - zemu_log_stack("Chain is NOT DEFAULT"); } + zemu_log_stack("Chain is NOT supported"); return parser_ok; }