forgotten BDB cope

(cherry picked from commit 073e8cf98b)
This commit is contained in:
scgbckbone 2023-11-07 13:52:17 +01:00 committed by doc-hex
parent 545b23f1b4
commit 5d69d5c039
2 changed files with 15 additions and 3 deletions

View File

@ -206,7 +206,7 @@ def bitcoind_wallet(bitcoind):
# Use bitcoind to create a temporary wallet file
w_name = 'ckcc-test-wallet-%s' % uuid.uuid4()
conn = bitcoind.create_wallet(wallet_name=w_name, disable_private_keys=True, blank=True,
passphrase=None, avoid_reuse=False, descriptors=False)
passphrase=None, avoid_reuse=False, descriptors=not bitcoind.has_bdb)
yield conn

View File

@ -22,7 +22,7 @@ from pprint import pprint
@pytest.mark.parametrize('way', ["sd", "vdisk", "nfc"])
def test_export_core(way, dev, use_regtest, acct_num, pick_menu_item, goto_home, cap_story,
need_keypress, microsd_path, virtdisk_path, bitcoind_wallet, bitcoind_d_wallet,
enter_number, nfc_read_text, load_export):
enter_number, nfc_read_text, load_export, bitcoind):
# test UX and operation of the 'bitcoin core' wallet export
from pycoin.contrib.segwit_addr import encode as sw_encode
use_regtest()
@ -115,11 +115,23 @@ def test_export_core(way, dev, use_regtest, acct_num, pick_menu_item, goto_home,
assert expect in desc
assert expect+f'/{n}/*' in desc
# test against bitcoind
if bitcoind.has_bdb:
# test against bitcoind
# only legacy wallets do support importmulti
for x in obj:
x['label'] = 'testcase'
bitcoind_wallet.importmulti(obj)
x = bitcoind_wallet.getaddressinfo(addrs[-1])
pprint(x)
assert x['address'] == addrs[-1]
if 'label' in x:
# pre 0.21.?
assert x['label'] == 'testcase'
else:
assert x['labels'] == ['testcase']
assert x['iswatchonly'] == True
assert x['iswitness'] == True
# assert x['hdkeypath'] == f"m/84'/1'/{acct_num}'/0/%d" % (len(addrs)-1)