diff --git a/shared/address_explorer.py b/shared/address_explorer.py index 783acb0c..2d51cac9 100644 --- a/shared/address_explorer.py +++ b/shared/address_explorer.py @@ -405,7 +405,7 @@ def generate_address_csv(path, addr_fmt, ms_wallet, account_num, n, start=0, cha # saver will be None if we don't think it worth saving these addresses saver = OWNERSHIP.saver(ms_wallet, change, start, n) - for line in ms_wallet.generate_address_csv(start, n, change): + for line in ms_wallet.generate_address_csv(start, n, change, saver=saver): yield line if saver: diff --git a/shared/wallet.py b/shared/wallet.py index 270d4b06..b9934a47 100644 --- a/shared/wallet.py +++ b/shared/wallet.py @@ -646,7 +646,7 @@ class MiniScriptWallet(WalletABC): return msg, addrs - def generate_address_csv(self, start, n, change): + def generate_address_csv(self, start, n, change, saver=None): scripts = settings.get("aemscsv", False) header = ['Index', 'Payment Address'] if scripts: @@ -654,6 +654,9 @@ class MiniScriptWallet(WalletABC): yield '"' + '","'.join(header) + '"\n' for idx, addr, ders, script in self.yield_addresses(start, n, change, scripts=scripts): + if saver: + saver(addr, idx) + ln = '%d,"%s"' % (idx, addr) if scripts: ln += ',"%s"' % script diff --git a/testing/test_ownership.py b/testing/test_ownership.py index 2dfb101e..6e0cd8cb 100644 --- a/testing/test_ownership.py +++ b/testing/test_ownership.py @@ -353,14 +353,17 @@ def test_address_explorer_saver(af, wipe_cache, settings_set, goto_address_explo assert addr == addr_from_display_format(story.split("\n\n")[0]) assert title == ('Verified Address' if is_q1 else "Verified!") assert 'Found in wallet' in story - if "ms" not in af: - assert 'Derivation path' in story - if af == "Segwit P2WPKH": - assert " P2WPKH " in story - elif af == "Classic P2PKH": - assert " P2PKH " in story - else: + assert 'Derivation path' in story + if is_q1: assert af in story + else: + if "ms" in af: + assert af in story + elif af == "P2SH-Segwit": + assert af in story + else: + part = af.split(" ")[1] + assert part in story def test_ae_saver(wipe_cache, settings_set, goto_address_explorer, cap_story,