From 950589215b901f3fa11d630da792f05fffbbc5b2 Mon Sep 17 00:00:00 2001 From: scgbckbone Date: Sat, 27 May 2023 11:37:48 +0200 Subject: [PATCH] remove label from bitcoin core export - in 24.1 label is no longer supported with ranged descriptors (cherry picked from commit 0874324372054303533f2ff7630219aa5bb544c0) --- releases/ChangeLog.md | 2 ++ shared/export.py | 1 - testing/pytest.ini | 4 ++-- testing/test_export.py | 8 ++++++-- unix/variant/pyb.py | 6 +++--- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/releases/ChangeLog.md b/releases/ChangeLog.md index 80168d35..1828db93 100644 --- a/releases/ChangeLog.md +++ b/releases/ChangeLog.md @@ -6,6 +6,8 @@ - Bugfix: correct `scriptPubkey` parsing for segwit v1-v16 - Bugfix: do not infer segwit just by availability of `PSBT_IN_WITNESS_UTXO` in PSBT. Improves compatibility with Bitcoin Core. +- Bugfix: remove label from Bitcoin Core `importdescriptors` export as it is no longer supported + with ranged descriptors in version `24.1` ## 5.1.2 - 2023-04-07 diff --git a/shared/export.py b/shared/export.py index 06f5d3ef..1a050643 100644 --- a/shared/export.py +++ b/shared/export.py @@ -345,7 +345,6 @@ def generate_unchained_export(account_num=0): def generate_generic_export(account_num=0): # Generate data that other programers will use to import Coldcard (single-signer) - from descriptor import Descriptor, multisig_descriptor_template chain = chains.current_chain() master_xfp = settings.get("xfp") diff --git a/testing/pytest.ini b/testing/pytest.ini index 5c80ecdd..a56b54e9 100644 --- a/testing/pytest.ini +++ b/testing/pytest.ini @@ -1,7 +1,7 @@ [pytest] -addopts = -vvx --disable-warnings +;addopts = -vvx --disable-warnings # you need to comment above and uncomment below to use run_sim_tests.py -#addopts = -vv --disable-warnings +addopts = -vv --disable-warnings markers = bitcoind: indicates local bitcoind (testnet) will be needed onetime: test cant be combined with any others, likely needs board reset diff --git a/testing/test_export.py b/testing/test_export.py index c16c3b7b..0e66f963 100644 --- a/testing/test_export.py +++ b/testing/test_export.py @@ -142,7 +142,9 @@ def test_export_core(way, dev, use_regtest, acct_num, pick_menu_item, goto_home, assert expect+f'/{n}/*' in desc # test against bitcoind -- needs a "descriptor native" wallet - bitcoind_d_wallet.importdescriptors(obj) + res = bitcoind_d_wallet.importdescriptors(obj) + assert res[0]["success"] + assert res[1]["success"] x = bitcoind_d_wallet.getaddressinfo(addrs[2]) pprint(x) assert x['address'] == addrs[2] @@ -171,7 +173,9 @@ def test_export_core(way, dev, use_regtest, acct_num, pick_menu_item, goto_home, assert expect + f'/{n}/*' in desc # test against bitcoind -- needs a "descriptor native" wallet - bitcoind_d_wallet.importdescriptors(obj) + res = bitcoind_d_wallet.importdescriptors(obj) + assert res[0]["success"] + assert res[1]["success"] x = bitcoind_d_wallet.getaddressinfo(addrs[-1]) pprint(x) diff --git a/unix/variant/pyb.py b/unix/variant/pyb.py index d22bb1b6..fe8e7ca2 100644 --- a/unix/variant/pyb.py +++ b/unix/variant/pyb.py @@ -36,10 +36,10 @@ class USB_HID: import usocket as socket self.pipe = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) # If on linux, try commenting the following line - addr = bytes([len(self.fn)+2, socket.AF_UNIX] + list(self.fn)) + # addr = bytes([len(self.fn)+2, socket.AF_UNIX] + list(self.fn)) # If on linux, try uncommenting the following two lines - #import struct - #addr = struct.pack('H108s', socket.AF_UNIX, self.fn) + import struct + addr = struct.pack('H108s', socket.AF_UNIX, self.fn) while 1: try: self.pipe.bind(addr)