bugfix: fwd slash in multisig name caused export to yikes. Replace fwd slash with dash in export filenames

This commit is contained in:
scgbckbone 2025-12-24 17:28:54 +01:00 committed by doc-hex
parent 5d9ab62595
commit b1fe2cca26
3 changed files with 32 additions and 1 deletions

View File

@ -9,6 +9,7 @@ This lists the new changes that have not yet been published in a normal release.
- New Feature: Support for v3 transactions
- New Feature: Send keystrokes with all derived BIP-85 secrets
- Enhancement: CCC allow to reset block height
- Bugfix: Replace `/` with `-` in exported file names of multisig wallet export artifacts
# Mk4 Specific Changes

View File

@ -865,7 +865,8 @@ class MultisigWallet(WalletABC):
def make_fname(self, prefix, suffix='txt'):
rv = '%s-%s.%s' % (prefix, self.name, suffix)
return rv.replace(' ', '_')
rv = rv.replace(' ', '_')
return rv.replace('/', '-')
async def export_electrum(self):
# Generate and save an Electrum JSON file.

View File

@ -4175,4 +4175,33 @@ def test_af_matching_convoluted_case(af, psbt_v2, clear_ms, fake_ms_txn, import_
assert len(po.inputs[0].part_sigs) == 0 # considered not ours
assert len(po.inputs[1].part_sigs) == 1 # signature added
def test_fwd_slash_in_name(import_ms_wallet, clear_ms, pick_menu_item, need_keypress, cap_story,
press_cancel, garbage_collector, microsd_path):
clear_ms()
name = "2/3 me/her/it"
import_ms_wallet(2,3, "p2wsh", name=name, accept=True)
pick_menu_item("Settings")
pick_menu_item("Multisig Wallets")
pick_menu_item(f"2/3: {name}")
pick_menu_item("Coldcard Export")
need_keypress("1") # SD
time.sleep(.1)
title, story = cap_story()
fname = story.split("\n\n")[1]
garbage_collector.append(microsd_path(fname))
assert fname.strip().startswith("export-2-3_me-her-it")
press_cancel()
press_cancel()
pick_menu_item("Descriptors")
pick_menu_item("Export")
need_keypress("1") # SD
time.sleep(.1)
title, story = cap_story()
fname = story.split("\n\n")[1]
garbage_collector.append(microsd_path(fname))
assert fname.strip().startswith("desc-2-3_me-her-it")
press_cancel()
press_cancel()
# EOF