test: reenable LedgerX tests
What changed, and why it matters
This commit only re-enables automated tests for Ledger Nano X hardware wallets. It removes code that was skipping certain tests, but makes no changes to the actual wallet-interaction code that users rely on. There is no security fix or vulnerability here.
No security action needed. Treat as routine test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff removes five unittest.SkipTest blocks in test/test_device.py that previously bypassed sign-transaction, big-transaction, display-address, and sign-message tests when running against non-legacy Ledger emulators (Ledger Nano X). No production/library code is modified. The change is purely test-suite maintenance.
Changed components
test/test_device.pyInspect captured patch +0 / −20
diff --git a/test/test_device.py b/test/test_device.py
index 33d3955..af26c5c 100644
--- a/test/test_device.py
+++ b/test/test_device.py
@@ -595,20 +595,12 @@ class TestSignTx(DeviceTestCase):
# https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927
raise unittest.SkipTest("Coldcard sign test temporarily disabled")
- if self.emulator.type == "ledger" and not self.emulator.legacy:
- # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927
- raise unittest.SkipTest("Test temporarily disabled for NanoX")
-
for addrtypes, multisig_types, external, op_return in self.signtx_cases:
with self.subTest(addrtypes=addrtypes, multisig_types=multisig_types, external=external, op_return=op_return):
self._test_signtx(addrtypes, multisig_types, external, op_return)
# Make a huge transaction which might cause some problems with different interfaces
def test_big_tx(self):
- if self.emulator.type == "ledger" and not self.emulator.legacy:
- # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927
- raise unittest.SkipTest("Test temporarily disabled for NanoX")
-
# make a huge transaction
keypool_desc = self.do_command(self.dev_args + ["getkeypool", "--account", "10", "--addr-type", "sh_wit", "0", "100"])
self.assertIsInstance(keypool_desc, list, f"getkeypool returned error: {keypool_desc}")
@@ -640,10 +632,6 @@ class TestSignTx(DeviceTestCase):
class TestDisplayAddress(DeviceTestCase):
def test_display_address_path(self):
- if self.emulator.type == "ledger" and not self.emulator.legacy:
- # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927
- raise unittest.SkipTest("Test temporarily disabled for NanoX")
-
result = self.do_command(self.dev_args + ['displayaddress', "--addr-type", "legacy", '--path', 'm/44h/1h/0h/0/0'])
if self.emulator.supports_legacy:
self.assertNotIn('error', result)
@@ -669,10 +657,6 @@ class TestDisplayAddress(DeviceTestCase):
self.assertEqual(result['code'], -7)
def test_display_address_descriptor(self):
- if self.emulator.type == "ledger" and not self.emulator.legacy:
- # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927
- raise unittest.SkipTest("Test temporarily disabled for NanoX")
-
account_xpub = self.do_command(self.dev_args + ['getxpub', 'm/84h/1h/0h'])['xpub']
p2sh_segwit_account_xpub = self.do_command(self.dev_args + ['getxpub', 'm/49h/1h/0h'])['xpub']
legacy_account_xpub = self.do_command(self.dev_args + ['getxpub', 'm/44h/1h/0h'])['xpub']
@@ -794,10 +778,6 @@ class TestSignMessage(DeviceTestCase):
self.assertTrue(self.rpc.verifymessage(addr, sig, msg))
def test_sign_msg(self):
- if self.emulator.type == "ledger" and not self.emulator.legacy:
- # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927
- raise unittest.SkipTest("Test temporarily disabled for NanoX")
-
self._check_sign_msg("Message signing test")
self._check_sign_msg("285") # Specific test case for Ledger shorter S
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.