From 4e7b0307db28736da97fee3254d460975639064b Mon Sep 17 00:00:00 2001 From: Sarah GLINER Date: Thu, 26 Oct 2023 12:00:09 +0200 Subject: [PATCH] Qtum: remove associated code and mark variant as deprecated --- Makefile | 13 ++++--------- include/btchip_context.h | 1 - include/btchip_filesystem.h | 1 - src/btchip_apdu_hash_input_finalize_full.c | 4 ++-- src/main.c | 4 ++-- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 1abeaf5f..0ac9f7b7 100644 --- a/Makefile +++ b/Makefile @@ -132,12 +132,7 @@ DEFINES += BIP44_COIN_TYPE=20 BIP44_COIN_TYPE_2=20 COIN_P2PKH_VERSION=30 COIN_ APPNAME ="Digibyte" APP_LOAD_PARAMS += --path $(APP_PATH) else ifeq ($(COIN),qtum) -# Qtum -# Qtum can run significantly different code paths, thus is locked by the OS -# using APP_LOAD_PARAMS instead of BIP44_COIN_TYPE -DEFINES += BIP44_COIN_TYPE=0 BIP44_COIN_TYPE_2=0 COIN_P2PKH_VERSION=58 COIN_P2SH_VERSION=50 COIN_FAMILY=3 COIN_COINID=\"Qtum\" COIN_COINID_HEADER=\"QTUM\" COIN_COINID_NAME=\"QTUM\" COIN_COINID_SHORT=\"QTUM\" COIN_NATIVE_SEGWIT_PREFIX=\"qc\" COIN_KIND=COIN_KIND_QTUM COIN_FLAGS=FLAG_SEGWIT_CHANGE_SUPPORT -APPNAME ="Qtum" -APP_LOAD_PARAMS += --path "44'/88'" --path "49'/88'" --path "84'/88'" --path "0'/45342'" --path "20698'/3053'/12648430'" +$(error the qtum variant is deprecated and has been moved to its dedicated repo else ifeq ($(COIN),firo) DEFINES += BIP44_COIN_TYPE=136 BIP44_COIN_TYPE_2=136 COIN_P2PKH_VERSION=82 COIN_P2SH_VERSION=7 COIN_FAMILY=1 COIN_COINID=\"Zcoin\" COIN_COINID_HEADER=\"FIRO\" COIN_COINID_NAME=\"Firo\" COIN_COINID_SHORT=\"FIRO\" COIN_KIND=COIN_KIND_FIRO APPNAME ="Firo" @@ -196,7 +191,7 @@ APPNAME ="Hydra" APP_LOAD_PARAMS += --path "44'/609'" else ifeq ($(filter clean,$(MAKECMDGOALS)),) -$(error Unsupported COIN - use bitcoin_testnet, bitcoin, bitcoin_cash, bitcoin_gold, litecoin, dogecoin, dash, zcash, horizen, komodo, stratis, peercoin, pivx, viacoin, vertcoin, stealth, digibyte, qtum, bitcoin_private, firo, gamecredits, zclassic, xsn, nix, lbry, resistance, ravencoin, hydra, hydra_testnet, xrhodium) +$(error Unsupported COIN - use bitcoin_testnet, bitcoin, bitcoin_cash, bitcoin_gold, litecoin, dogecoin, dash, zcash, horizen, komodo, stratis, peercoin, pivx, viacoin, vertcoin, stealth, digibyte, bitcoin_private, firo, gamecredits, zclassic, xsn, nix, lbry, resistance, ravencoin, hydra, hydra_testnet, xrhodium) endif endif @@ -329,11 +324,11 @@ dep/%.d: %.c Makefile ifeq ($(TARGET_NAME),TARGET_NANOS) listvariants: - @echo VARIANTS COIN bitcoin_testnet_legacy bitcoin_legacy bitcoin_cash bitcoin_gold litecoin dogecoin dash horizen komodo stratis peercoin pivx viacoin vertcoin stealth digibyte qtum bitcoin_private firo gamecredits zclassic xsn nix lbry ravencoin resistance hydra hydra_testnet xrhodium + @echo VARIANTS COIN bitcoin_testnet_legacy bitcoin_legacy bitcoin_cash bitcoin_gold litecoin dogecoin dash horizen komodo stratis peercoin pivx viacoin vertcoin stealth digibyte bitcoin_private firo gamecredits zclassic xsn nix lbry ravencoin resistance hydra hydra_testnet xrhodium else listvariants: - @echo VARIANTS COIN bitcoin_testnet_legacy bitcoin_legacy bitcoin_cash bitcoin_gold litecoin dogecoin dash horizen komodo stratis peercoin pivx viacoin vertcoin stealth digibyte qtum bitcoin_private firo gamecredits zclassic xsn nix lbry ravencoin hydra hydra_testnet xrhodium + @echo VARIANTS COIN bitcoin_testnet_legacy bitcoin_legacy bitcoin_cash bitcoin_gold litecoin dogecoin dash horizen komodo stratis peercoin pivx viacoin vertcoin stealth digibyte bitcoin_private firo gamecredits zclassic xsn nix lbry ravencoin hydra hydra_testnet xrhodium endif diff --git a/include/btchip_context.h b/include/btchip_context.h index d199fea7..562fbd65 100644 --- a/include/btchip_context.h +++ b/include/btchip_context.h @@ -277,7 +277,6 @@ typedef enum btchip_coin_kind_e { COIN_KIND_VIACOIN, COIN_KIND_VERTCOIN, COIN_KIND_DIGIBYTE, - COIN_KIND_QTUM, COIN_KIND_BITCOIN_PRIVATE, COIN_KIND_XRHODIUM, COIN_KIND_HORIZEN, diff --git a/include/btchip_filesystem.h b/include/btchip_filesystem.h index 555953c8..3bbdc04d 100644 --- a/include/btchip_filesystem.h +++ b/include/btchip_filesystem.h @@ -34,7 +34,6 @@ enum btchip_supported_modes_e { enum btchip_family_e { BTCHIP_FAMILY_BITCOIN = 0x01, BTCHIP_FAMILY_PEERCOIN = 0x02, - BTCHIP_FAMILY_QTUM = 0x03, BTCHIP_FAMILY_STEALTH = 0x04 }; diff --git a/src/btchip_apdu_hash_input_finalize_full.c b/src/btchip_apdu_hash_input_finalize_full.c index 8c12d49e..e023aa73 100644 --- a/src/btchip_apdu_hash_input_finalize_full.c +++ b/src/btchip_apdu_hash_input_finalize_full.c @@ -70,10 +70,10 @@ static bool check_output_displayable() { isOpCall = btchip_output_script_is_op_call(btchip_context_D.currentOutput + 8, sizeof(btchip_context_D.currentOutput) - 8); - if (((G_coin_config->kind == COIN_KIND_QTUM || G_coin_config->kind == COIN_KIND_HYDRA) && + if (((G_coin_config->kind == COIN_KIND_HYDRA) && !btchip_output_script_is_regular(btchip_context_D.currentOutput + 8) && !isP2sh && !(nullAmount && isOpReturn) && !isOpCreate && !isOpCall) || - (!(G_coin_config->kind == COIN_KIND_QTUM || G_coin_config->kind == COIN_KIND_HYDRA) && + (!(G_coin_config->kind == COIN_KIND_HYDRA) && !btchip_output_script_is_regular(btchip_context_D.currentOutput + 8) && !isP2sh && !(nullAmount && isOpReturn))) { PRINTF("Error : Unrecognized output script"); diff --git a/src/main.c b/src/main.c index 9f7ac4d6..13c704f9 100644 --- a/src/main.c +++ b/src/main.c @@ -203,12 +203,12 @@ void get_address_from_output_script(unsigned char* script, int script_size, char strncpy(out, "OP_RETURN", out_size); return; } - if ((G_coin_config->kind == COIN_KIND_QTUM || G_coin_config->kind == COIN_KIND_HYDRA) && + if ((G_coin_config->kind == COIN_KIND_HYDRA) && btchip_output_script_is_op_create(script, script_size)) { strncpy(out, "OP_CREATE", out_size); return; } - if ((G_coin_config->kind == COIN_KIND_QTUM || G_coin_config->kind == COIN_KIND_HYDRA) && + if ((G_coin_config->kind == COIN_KIND_HYDRA) && btchip_output_script_is_op_call(script, script_size)) { strncpy(out, "OP_CALL", out_size); return;