Skip to content

Commit

Permalink
Qtum: remove associated code and mark variant as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
sgliner-ledger committed Oct 26, 2023
1 parent 6ecc089 commit 4e7b030
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
1 change: 0 additions & 1 deletion include/btchip_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion include/btchip_filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
4 changes: 2 additions & 2 deletions src/btchip_apdu_hash_input_finalize_full.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4e7b030

Please sign in to comment.