diff --git a/bitcoin_client/ledger_bitcoin/client_legacy.py b/bitcoin_client/ledger_bitcoin/client_legacy.py index 475087cfa..f5d45f366 100644 --- a/bitcoin_client/ledger_bitcoin/client_legacy.py +++ b/bitcoin_client/ledger_bitcoin/client_legacy.py @@ -77,8 +77,8 @@ def __init__(self, comm_client: TransportClient, chain: Chain = Chain.MAIN, debu self.app = btchip(DongleAdaptor(comm_client)) - if self.app.getAppName() not in ["Qtum", "Qtum Legacy", "Qtum Test", "Qtum Test Legacy", "app"]: - raise ValueError("Ledger is not in either the Qtum or Qtum Testnet app") + if self.app.getAppName() not in ["Bitcoin", "Bitcoin Legacy", "Bitcoin Test", "Bitcoin Test Legacy", "app"]: + raise ValueError("Ledger is not in either the Bitcoin or Bitcoin Testnet app") def get_extended_pubkey(self, path: str, display: bool = False) -> str: # mostly taken from HWI diff --git a/bitcoin_client/tests/conftest.py b/bitcoin_client/tests/conftest.py index 0e028c5d4..768871c19 100644 --- a/bitcoin_client/tests/conftest.py +++ b/bitcoin_client/tests/conftest.py @@ -7,6 +7,6 @@ # path with tests conftest_folder_path: Path = Path(__file__).parent -os.environ['SPECULOS_APPNAME'] = 'Qtum Test:1.6.5' -os.environ["BITCOIN_APP_BINARY"] = str(conftest_folder_path.joinpath("app-binaries/qtum-testnet-1.6.5.elf")) -os.environ["BITCOIN_APP_LIB_BINARY"] = str(conftest_folder_path.joinpath('app-binaries/qtum-1.6.5.elf')) +os.environ['SPECULOS_APPNAME'] = 'Bitcoin Test:1.6.5' +os.environ["BITCOIN_APP_BINARY"] = str(conftest_folder_path.joinpath("app-binaries/bitcoin-testnet-1.6.5.elf")) +os.environ["BITCOIN_APP_LIB_BINARY"] = str(conftest_folder_path.joinpath('app-binaries/bitcoin-1.6.5.elf')) diff --git a/bitcoin_client/tests/test_get_wallet_address_legacyapp.py b/bitcoin_client/tests/test_get_wallet_address_legacyapp.py index c9fa4c9e7..efa4e05e5 100644 --- a/bitcoin_client/tests/test_get_wallet_address_legacyapp.py +++ b/bitcoin_client/tests/test_get_wallet_address_legacyapp.py @@ -7,11 +7,11 @@ def test_get_wallet_address_singlesig_legacy(client: Client): name="", descriptor_template="pkh(@0/**)", keys_info=[ - f"[350a4bc9/44'/1'/0']tpubDCwYjpDhUdPGP5rS3wgNg13mTrrjBuG8V9VpWbyptX6TRPbNoZVXsoVUSkCjmQ8jJycjuDKBb9eataSymXakTTaGifxR6kmVsfFehH1ZgJT", + f"[f5acc2fd/44'/1'/0']tpubDCwYjpDhUdPGP5rS3wgNg13mTrrjBuG8V9VpWbyptX6TRPbNoZVXsoVUSkCjmQ8jJycjuDKBb9eataSymXakTTaGifxR6kmVsfFehH1ZgJT", ], ) - assert client.get_wallet_address(wallet, None, 0, 0, False) == "qc8MCVJwQZTNdM2JhXhBs41fxZzZ8HN9cR" - assert client.get_wallet_address(wallet, None, 1, 15, False) == "qbHdLA6nhsuNTvPoWZZm5RHSfXcLerpHLd" + assert client.get_wallet_address(wallet, None, 0, 0, False) == "mz5vLWdM1wHVGSmXUkhKVvZbJ2g4epMXSm" + assert client.get_wallet_address(wallet, None, 1, 15, False) == "myFCUBRCKFjV7292HnZtiHqMzzHrApobpT" def test_get_wallet_address_singlesig_wit(client: Client): @@ -20,11 +20,11 @@ def test_get_wallet_address_singlesig_wit(client: Client): name="", descriptor_template="wpkh(@0/**)", keys_info=[ - f"[350a4bc9/84'/1'/0']tpubDCtKfsNyRhULjZ9XMS4VKKtVcPdVDi8MKUbcSD9MJDyjRu1A2ND5MiipozyyspBT9bg8upEp7a8EAgFxNxXn1d7QkdbL52Ty5jiSLcxPt1P", + f"[f5acc2fd/84'/1'/0']tpubDCtKfsNyRhULjZ9XMS4VKKtVcPdVDi8MKUbcSD9MJDyjRu1A2ND5MiipozyyspBT9bg8upEp7a8EAgFxNxXn1d7QkdbL52Ty5jiSLcxPt1P", ], ) - assert client.get_wallet_address(wallet, None, 0, 0, False) == "tq1qzdr7s2sr0dwmkwx033r4nujzk86u0cy6dcmgce" - assert client.get_wallet_address(wallet, None, 1, 15, False) == "tq1qlrvzyx8jcjfj2xuy69du9trtxnsvjupefaqtd2" + assert client.get_wallet_address(wallet, None, 0, 0, False) == "tb1qzdr7s2sr0dwmkwx033r4nujzk86u0cy6fmzfjk" + assert client.get_wallet_address(wallet, None, 1, 15, False) == "tb1qlrvzyx8jcjfj2xuy69du9trtxnsvjuped7e289" def test_get_wallet_address_singlesig_sh_wit(client: Client): @@ -33,8 +33,8 @@ def test_get_wallet_address_singlesig_sh_wit(client: Client): name="", descriptor_template="sh(wpkh(@0/**))", keys_info=[ - f"[350a4bc9/49'/1'/0']tpubDC871vGLAiKPcwAw22EjhKVLk5L98UGXBEcGR8gpcigLQVDDfgcYW24QBEyTHTSFEjgJgbaHU8CdRi9vmG4cPm1kPLmZhJEP17FMBdNheh3", + f"[f5acc2fd/49'/1'/0']tpubDC871vGLAiKPcwAw22EjhKVLk5L98UGXBEcGR8gpcigLQVDDfgcYW24QBEyTHTSFEjgJgbaHU8CdRi9vmG4cPm1kPLmZhJEP17FMBdNheh3", ], ) - assert client.get_wallet_address(wallet, None, 0, 0, False) == "mNDsvaF9HHvEFaH6FmLRR3kAJoPBD3XfdW" - assert client.get_wallet_address(wallet, None, 1, 15, False) == "mZXUNuos7tQiTr6JVTHcqbFfrSTf8zGzxx" + assert client.get_wallet_address(wallet, None, 0, 0, False) == "2MyHkbusvLomaarGYMqyq7q9pSBYJRwWcsw" + assert client.get_wallet_address(wallet, None, 1, 15, False) == "2NAbM4FSeBQG4o85kbXw2YNfKypcnEZS9MR" diff --git a/bitcoin_client/tests/test_sign_psbt_legacyapp.py b/bitcoin_client/tests/test_sign_psbt_legacyapp.py index 71cf681f2..d52100b7c 100644 --- a/bitcoin_client/tests/test_sign_psbt_legacyapp.py +++ b/bitcoin_client/tests/test_sign_psbt_legacyapp.py @@ -30,7 +30,7 @@ def test_sign_psbt_singlesig_pkh_1to1(client: Client): "", "pkh(@0/**)", [ - "[350a4bc9/44'/1'/0']tpubDCwYjpDhUdPGP5rS3wgNg13mTrrjBuG8V9VpWbyptX6TRPbNoZVXsoVUSkCjmQ8jJycjuDKBb9eataSymXakTTaGifxR6kmVsfFehH1ZgJT" + "[f5acc2fd/44'/1'/0']tpubDCwYjpDhUdPGP5rS3wgNg13mTrrjBuG8V9VpWbyptX6TRPbNoZVXsoVUSkCjmQ8jJycjuDKBb9eataSymXakTTaGifxR6kmVsfFehH1ZgJT" ], ) @@ -61,7 +61,7 @@ def test_sign_psbt_singlesig_sh_wpkh_1to2(client: Client): "", "sh(wpkh(@0/**))", [ - "[350a4bc9/49'/1'/0']tpubDC871vGLAiKPcwAw22EjhKVLk5L98UGXBEcGR8gpcigLQVDDfgcYW24QBEyTHTSFEjgJgbaHU8CdRi9vmG4cPm1kPLmZhJEP17FMBdNheh3" + "[f5acc2fd/49'/1'/0']tpubDC871vGLAiKPcwAw22EjhKVLk5L98UGXBEcGR8gpcigLQVDDfgcYW24QBEyTHTSFEjgJgbaHU8CdRi9vmG4cPm1kPLmZhJEP17FMBdNheh3" ], ) @@ -94,7 +94,7 @@ def test_sign_psbt_singlesig_wpkh_1to2(client: Client): "", "wpkh(@0/**)", [ - "[350a4bc9/84'/1'/0']tpubDCtKfsNyRhULjZ9XMS4VKKtVcPdVDi8MKUbcSD9MJDyjRu1A2ND5MiipozyyspBT9bg8upEp7a8EAgFxNxXn1d7QkdbL52Ty5jiSLcxPt1P" + "[f5acc2fd/84'/1'/0']tpubDCtKfsNyRhULjZ9XMS4VKKtVcPdVDi8MKUbcSD9MJDyjRu1A2ND5MiipozyyspBT9bg8upEp7a8EAgFxNxXn1d7QkdbL52Ty5jiSLcxPt1P" ], ) @@ -126,7 +126,7 @@ def test_sign_psbt_singlesig_wpkh_2to2(client: Client): "", "wpkh(@0/**)", [ - "[350a4bc9/84'/1'/0']tpubDCtKfsNyRhULjZ9XMS4VKKtVcPdVDi8MKUbcSD9MJDyjRu1A2ND5MiipozyyspBT9bg8upEp7a8EAgFxNxXn1d7QkdbL52Ty5jiSLcxPt1P" + "[f5acc2fd/84'/1'/0']tpubDCtKfsNyRhULjZ9XMS4VKKtVcPdVDi8MKUbcSD9MJDyjRu1A2ND5MiipozyyspBT9bg8upEp7a8EAgFxNxXn1d7QkdbL52Ty5jiSLcxPt1P" ], )